Tuesday, May 24, 2011

Improving Remote Desktop speed on Vista/Win7

A fellow kept complaining that his Remote Desktop (mstsc) connection to the office is super slow. I told him that I had the same problem since I moved from Windows XP to Windows 7 & he found the following solution:

Run the following command line:
netsh interface tcp set global autotuninglevel=disabled
to undo it:
netsh interface tcp set global autotuninglevel=normal

For full details check this post. It's not optimal, but it works & I didn't notice any problem since.

Friday, May 13, 2011

Memory debugging and Android application

Using DDMS

*. Compile & run the application on an enumlator in debug (e.g. Manifest.xml, android:debuggable="true").
*. open DDMS

Checking the heap status:
*. Select your application, click on 'Show heap updates' on the toolbar.
*. Play around with your application and check the results.

Checking the allocations:
*. Select the allocation tracker tab, click on 'Start Tracking'
*. Press 'Get Allocations' when you want to check the allocations.

Note: do not use both heap status & allocations - the heap monitoring will cause a lot of allocations.

Tuesday, May 3, 2011

Display ListPreference value in the preferences screen

One missing feature in the preferences activity in Android applications is to display the selected value of a ListPreference. By default, to view the selected value of a ListPreference you must click the preference and see what's selected in the combo box.

Here's an example how to create a preferences activity which displays the selected value of any number of ListPreferences in the activity.


  • This code will update the values if the user selects a new value

  • If you're defining preferences keys in the strings.xml file, make the mListPreferencesKeys list an integer list, and get the string at run time using 'getString'