Running google map application on Android Emulator

后端 未结 6 729
野趣味
野趣味 2020-11-30 13:07

My application uses Google Maps v2. This application successfully working on Android powered device. I tried to run the same application on Android emulator. The target of m

相关标签:
6条回答
  • 2020-11-30 13:37

    First make sure you have internet access

    and the the following permission in your manifest: `

    <permission
        android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>
    <uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE"/>
    
    <!--
    

    The ACCESS_COARSE/FINE_LOCATION permissions are not required to use Google Maps Android API v2, but are recommended. --> `

    0 讨论(0)
  • 2020-11-30 13:38

    I got finally map in my emulator. I followed these steps to achieve it.

    1. Create avd and start emulator

    2. Go to platform tools path present in Android SDK and put these apk's in it.

      • com.android.vending-20130716
      • com.google.android.gms-20130716
    3. Install these apk's one by one by going to platform tools path by using command prompt(shift+Right click-->open command window here).Follow these commands
      • adb devices
      • adb install com.android.vending-20130716
      • adb install com.google.android.gms-20130716
    4. Import google-play-services_lib project which is present at project location and add it to your project.
    5. Restart emulator and clean your project and run it through emulator.

    That's it. :) you can download above apk's from following link

    Running Google Maps v2 on the Android emulator

    enter image description here

    0 讨论(0)
  • 2020-11-30 13:41

    In Android 4.4, it is now possible to run Google Maps in the Android emulator, even with Intel HAXM AVD. No need to run anything on the adb command anymore. It takes several steps, though. I created a series of videos on the subject, if it helps. I use a JSON feed to put markers on a map in a 4.4 emulator. They are about 30 minutes each, so you may want to skip ahead to find what you want. The first two videos are the most relevant for this question. I have three more videos in the series that deal with JSON and markers... see my YouTube channel for those.

    1) Using Google Maps in Android Emulator (general setup and prereqs) https://www.youtube.com/watch?v=gT-kORiFRTo 2) Show maps in Android emulator https://www.youtube.com/watch?v=0MZIYkm3Ezg

    Thanks and good luck!

    Brandan

    0 讨论(0)
  • 2020-11-30 13:41

    Google map can not load in emulator.

    You need to install application in real device.

    Or optionally you can use Bluestack and test your application in it.

    http://bluestacks.com/

    0 讨论(0)
  • 2020-11-30 13:56

    Google Maps v2 requires Google Play Services , it's not available in Android emulator. You can try this blog post , should be helpful for you.

    http://javamvp.blogspot.com/2013/06/put-android-maps-v2-work-on-your.html

    If map loading is the only issue you have then I am pretty sure that its api key issue. Please recheck that in manifest.

    0 讨论(0)
  • 2020-11-30 13:58
    1. To display Google map in the emulator, you can use a "browser key" from google developer console, instead of the Android key.This is because the android key is private therefore will only display the map on a real device, however by using a browser key, in your manifest file , you can run your map on an android emulator. To create a browser key goto "https://code.google.com/apis/console/" , for the website, leave it blank and just click create. Use the generated key in your manifest file an this should display the map.

    2. I also suggest you use install gene-motion emulator, download and install google play services on it and you will be good to go.

    0 讨论(0)
提交回复
热议问题