I am facing a strange issue wherein HTML5 Geolocation is not working only on Android Emulator. I have a very simple code as follows:
navigator.geolocation.getCurrentPosition(suc, locFail, { 'enableHighAccuracy': true, 'timeout': 60000, 'maximumAge': 60000 });
Once the emulator is running I do supply mock coordinates using DDMS/telnet geo fix.
But the moment it executes the above line of code, the emulator hangs. In LogCat I get messages notifying that each service is dying and then I get the Android Emulator Launch screen. I cannot do anything with the emulator except closing it and restarting it.
Version of Android: 2.3.3
ADT Version: 20
Emulator Settings: Allow mock locations is enabled. Use GPS Satellites is enabled.
The same code works perfectly fine on my desktop browser.
Any help will be highly appreciated.
Thank you
When you create an AVD, you will see two versions. For e.g. The Target names for 2.3.3 will be Android 2.3.3 and Google APIs (Google Inc). Try selecting the Google APIs version for your AVD and see if it works.