Sunday, February 13, 2011

Problem uninstalling Android SDK samples

This is the second time it happens to me so I've decided to write a post about it.

Problem: in the "Android SDK and AVD Manager"/"SDK Setup" selecting "Samples for SDK ..." package and clicking 'delete' deletes the content of the samples folder, but does not remove the entry from the "Android SDK and AVD Manager".

1. Close the "Android SDK and AVD Manager"/"SDK Setup" (close the eclipse if it's running).
2. Delete the SDK specific samples folder. If the folder is locked kill any 'java.exe' process running (or reboot).
3. Restart the "Android SDK and AVD Manager"/"SDK Setup"

Distance on earth calculation in SQL

Here's how to create an SQL function to calculate the distance (in KM) between to points on earth. This is an estimation since the distance is calculated as if the earth was round, but it's close enough for most purposes: