Tuesday, December 4, 2012

Updating Android SDK using Eclipse on Windows 7

Recently I was trying to get my head around few errors related to Android SDK updates. I wanted to upgrade the API and install few updates related to SDK tools.

When you open Android SDK Manager, you expect to load all updates and other packages automatically. But this is not the case when you start your Android SDK Manager in Eclipse (Pretty bad).

By default, download cache is enabled and Android SDK Manager uses cache to load the data.

By disabling cache you can see the available updates.
  • Click Tools > Options. 
  • Uncheck Use download Cache checkbox.
  • Hit Clear Cache button.
  • Restart Android SDK Manager.
Now you should see available updates.





Friday, February 24, 2012

IE 8 and Ajax Support

Recently I came across few bugs related to IE 8, Ajax and JSF.
The main issue was a delay in firing ajax events in IE 8. For example, when user clicked on a radio button, the event did not fire immediately. The event did not get fired on first click. User had to click on radio button and then somewhere else on web page to see the expected result. After spending some time, I found the solution. The solution is using Javascript blur() function,

The blur function is used to remove the focus from the object that it belongs to. Before applying this solution, user had to click somewhere else on webpage to remove the focus from the current object.



Here is the code sample. Write simple Javascript function to blur the object.


Then in html/jsp/xhtml code we call function blurAction on the onclick attribute.

   


The clicked object becomes non-current immediately and we can fire ajax events.