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.
Try to move to the Google Maps version of the AVD and see if you are able to see the mock locations.
Related
I have tried everything I can think of and everything I have looked up online. None get me progress. On the phone I have activatied developer mode, I am using a cord that can transfer files, and I have given computer permission to access my phone. On the computer end I have updated every thing I can think of and I am able to see my phones storage from it but the device does not appear on android studio.
The laptop runs on Windows 8 (unfortunately).
Ask if any other info is needed.
Thank you in advance, I'm getting desperate.
CHECK IF YOUR DEVICE API LEVEL IS LOWER THAN THA APP MINIMUM API LEVEL
it might happen that the app you are building is build for a higher android-version. like if you are building an app for api 21 and your device is have api level 17 then it wont show your device in the list of connected devices. once i faced this problem
I would like to test GPS on google maps on android.
Standard google emulator is very slow and has problems with google maps.
Geanymotion is not always detected, even if it's connected there's problem with Emulator Control which is deactivated for standard device and genymotion even if it is connected, detected, selected proper device and application process.
I know there is no eclipse/studio issue but tested it on both with the same result.
Restarting adb from IDE or command line does not work either.
I use Eclipse and Android SDK to develop apps for android,recently i wrote a program to show a map on it, it works fine on real device but it don't show any map on emulator.
I check the emulator internet connection and it works and i checked the browser on emulator and it works and i checked the Google map app on the emulator and it show me an black page.
I think about a graphical library or something would be missing, is it possible ? what can i do to correct it?
PS:
1-I use Google APIs 4.2.2 image.
2-I know there are many emulator but they don't works with DDMS on Eclipse.for example DDMS can't send GPS location or SMS to theme or call theme.and i want some log system like LogCat.
You have to use genny motion . Its works like real device.
http://www.genymotion.com/
android genymotion vs emulator
use the following steps to make avd for s4 or any type:withe help of genymotion third party pulgin:
download first genymotion https://cloud.genymotion.com/page/launchpad/download/
cmd for install genymotion http://schier.co/post/install-genymotion-2.0-in-ubuntu
then: The installation of the plugin can be done by launching Eclipse and going to "Help / Install New Software" menu, then just add a new Update Site with the following URL: http://plugins.genymotion.com/eclipse.
installing the google play service from the following : http://blog.zeezonline.com/2013/11/install-google-play-on-genymotion-2-0/
Genny Motion is the best solution by far and had almost all features a developer needs.
But the reason that i cant see the map is the time i should wait and https protocol which is don't work properly in our country because of it's encryption ,it seems it took a while to appear a map, i left the program to eat dinner , when i came back it appears !!! but Google map App still don't work , maybe it needs time too.
Emulator does not having gps hardware to run google map, that the reason it's showing blank, To run Map we need both a internet and gps as well.
I have have been using the Android emulator both and the command-line and in Intellij for some weeks running ApiDemos and my own apps with no problems.
Now, without any exceptions or messages to indicate the reason why the emulator will only run the emergency call app and nothing more.
Is this a bug? If so, how do I create an issue for the Android SDK dev?
I'm cautious to load any .apk now into my handset to see if the condition is the same.
Particulars follow:
OS: Ubuntu 12.04
Android SDK: 4.1 (ICS).
JDK: 1.7.x
Maybe a stupid answer, but are you sure you didn't set a PIN code on the lock screen? This will load the PIN entry screen whenever you load the emulator but still allow you to make emergency calls.
You have to set a PIN on Android ICS when you save new security certificates, which caught me out.
You need to use 2 GB of RAM o avoid that problem in your android emulator.
I developed an android maps application on Google API 2.1 update-1 platform. And it is the simplest code to show a map on the screen, there is no other things.
However, map doesn't shown on phone. The problem is, the same program runs on my android emulator right but it is not working on my android phone properly, I mean program starts on phone but I see only greeds instead of map. phone android version is th same, 2.1 update-1.
Please help me,
Thanks.
If the same APK file works on the emulator but does not work on the phone, ensure that:
The phone has a working Internet connection
The phone's built-in Maps application works