I know this topics already have posted. But I am not success for this work.I can not run google map v2 in emulator. Now I am trying BlueStack. When I run BlueStack then it show Get Google Play Service. What I do please tell me.How I can run google map v2 successfully.
My AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gmapdemon"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY_KEYandroid"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"
/>
<activity
android:name="com.example.gmapdemon.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Create an emulator from genymotion that supports google map api. You can look this up.
Find a download for the app store that will run on your emulator. I found mine here: http://wiki.rootzwiki.com/Google_Apps#Universal_Packages_2... I was using the 4.2.2 version.
Drag and drop that into your emulator. I am using google nexus.
Say ok to the prompts.
Once everything is installed close down the emulator and restart.
sign up with a good account.
VoilĂ
Related
I've been working on an android app for the past little while and I wanted to set it up to connect to Google Maps. I've been writing it inside Eclipse with the ADT plugins. I followed this tutorial but I've been getting the following Error when I try to load maps.
"failed to load map. error contacting google servers. this is probably an authentication issue (but could be do to network errors)"
Since I can access google maps in other apps it has to be an authentication error. I've tried uninstalling the app from my phone but that does not fix the error.
The SHA1 that eclipse is using (according to window > properties > android > build) is 58:EF:6F:DE:DE:B4:4E:EB:20:15:68:39:08:5D:87:32:FE:20:99:99
I used this to generate an API key in the google console which you can see contained below in my manifest file. The app I specified in the console was 58:EF:6F:DE:DE:B4:4E:EB:20:15:68:39:08:5D:87:32:FE:20:99:99;com.example.test. It may be worth noting that I'm loading the map inside an activity located in the gui package, not the com.example.test package that contains MainActivity.
I've been testing this on my nexus 5 by clicking play in eclipse while the phone is plugged into my computer.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="19" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="com.example.test.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBsTBliiyhE2G4Navzfc1ANeI9f7JwAtEM" />
<activity
android:name="com.example.test.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="gui.SetLocationActivity"
android:label="#string/title_activity_set_location" >
</activity>
</manifest>
While I am trying to run Google Maps type apps I try to run using my android device. But device is not showing in my eclipse browser. What should I do ?
Is there any alternate way to run these type of applications ?
my menifest file as below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- Requires OpenGL ES version 2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.googlemaps.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my key" />
</application>
</manifest>
Please Share what you have tried?
where you have to run this Application?
Please check Right click on the project->Run As->Run Configuration Now one window will show..That contains three tabs like Android,Target,Common.
1.You should select Launch default Activity in android tab
2.You should Select Automatically pick compatible Device
Ple try it
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="16" />
Ple Check this lines from Your manifest flie.. android:minSdkVersion="12" know..For Your Mobile Should not Greater than from 12.Please Check
This worked for me:
Create an apk file with same keystore key you have stored into Google Maps Console and install into your device. Installing into Android device using eclipse will not take your correct SHA1 key to view the Google Maps. As incorrect SHA1 key will lead to authentication failure.
vKj
I have followed this tutorial and I taked this ... without any error in Logcat view,If you have any idea about this error.
Thanks
I post to you my manifest code :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.maps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.maps.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Add Api key -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyAmklok-bwsgXzYLyBl4jLxFY3Gs6198YA" />
</application>
<!-- add Permisson -->
<permission
android:name="com.example.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- autres configs -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
</manifest>
All steps in many tutorials have a same code , I Think a problem is in emulator .
Google Map Api v2 wont show the map if you try to run it in Emulator or Device.
In order to show Map you need to sign the Application and then through command prompt try to install your application. Hope you will be able to get Map.
Few Steps required:-
1) You need add Libray project to your application
adt-bundle-windows-x86_64-20130219\adt-bundle-windows-x86_64-20130219\sdk\extras\google\google_play_services\libproject
Hope this will help you.
From the tutorial i read from this http://agusharyanto.net/wordpress/?p=893 from indonesia, you must use the google service library on the Google API that you choose and use another application venton.apk and gms.apk from adb command. If you dont understand the languages, try understand by look at the image explanation.
With reference to previous error
Link1
I want able to move one step ahead. But now i am facing two new errors.
04-05 14:24:27.156: E/Google Maps Android API(32366): Authorization failure.
04-05 14:24:27.966: E/Google Maps Android API(32366): Failed to load map. Could not contact Google servers.
This is only important content from my Manifest.xml file
<permission
android:name="com.example.task.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.task.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="_MY_API_KEY_GOES_IN_HERE_"/>
</application>
</manifest>
I have referred to the link
Link2
Link3
Make sure all below mentioned points are taken care:
1) Wrong service was enabled. Make sure the "Google Maps Android API v2", not "Google Maps API v2" is enabled and re-generate the API key.
2) Add the following elements to your manifest. Replace com.example.mapdemo with the package name of your application.
3) Use of correct certificate and key. Release certificate, which WILL NOT WORK during debugging when you run the app on my phone. You have to use the debugging keystore certificate fingerprint instead.
All,
Trying to use google v2 map api in my android application and can't get it to work, it keeps displaying a blank white page!
I even tried running samples from https://github.com/commonsguy/cw-omnibus/tree/master/MapsV2 and got the BasicMap application compiled and installed on my device but exactly same issue!
Since this is happening both for my code and this code that all I heard is a valid source I assume this is not the Key issue as these two use two different keys.
I've done all I could, here is manifest file from the sample:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commonsware.android.mapsv2.basic"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16"/>
<permission
android:name="com.commonsware.android.mapsv2.basic.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.SET_DEBUG_APP" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Sherlock.Light.DarkActionBar">
<uses-library android:name="com.google.android.maps" />
<activity
android:name="MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC4iyT46cB00IdKGcy5EmAxK5uCOQX2Oy8"/>
<activity android:name="LegalNoticesActivity">
</activity>
</application>
</manifest>
Any idea what this could be?
Try to follow the following guide I wrote for adding a Google Map Api V2:
Google Map API V2
and please share you logcat stack trace with us so we could understand more clearly what is your problem.