Discussion Forums  >  Maps, Device Location, Tracking

Replies: 37    Views: 179

S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
09/23/13 06:20 AM (10 years ago)

Need some help with Maps and API key V2.

Hi..need some help here please. I have my first app on AppStore. (very happy for that) I'm trying to build the same app for android but i have some problems with Maps and API key V2. -I have follow Installing Google Maps on Android pdf -Have install Eclipse Keytool -Have added Google Play Services Library in the project -Have great SHA1 figerprint -Have great api key form Google Developer API Access Have 2 problems first after editin Google Play services library in the project i can see the files Android Private Libaries -> google-play-services.jar but the google-play-services-remove.jar is missing from the Libs file. Second problem is that looks like there is some code missing in my AndroidManifest.xml file can't find the code to past the api key.. My code stops like this: <!-- THE NEXT LINE IS ONLY USED IF MAPS ARE USED --> <uses-library android:name="com.google.android.maps"/> </application> </manifest> Im sure that im missing something but I can't figure it out The app is guide app so really need the maps working. I'm self hosted v 2.1.9 & plugins are updated.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/23/13 07:32 AM (10 years ago)
I wrote a couple of tutorials that may help... This is for getting the v2 api key https://www.buzztouch.com/files/howtos/googleapiv2.pdf This is how to reference the Google Play Services library in your project; also needed if you're using Google Maps. https://www.buzztouch.com/files/howtos/GPSRefBT.pdf and each Android project should have this line in the AndroidManifest.xml, around line 78 or so... <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="GOOGLE_MAPS_FOR_ANDROID_V2_API_KEY_GOES_HERE"/> Of course, you'll replace that GOOGLE_MAPS... part for your real v2 key. Also valuable are GoNorthWests tutorials on the subject. Although not explicitly for API v2, the rhyme and reasons are the same regardless, and he visits a lot more on that subject than I do. The short suggestion is: Pay attention to his descriptions and recommendations on debug/release key usage. Meaning, just focus on the release key. https://www.buzztouch.com/files/howtos/Obtaining_a_Google_Maps_API_Key_v1.0.pdf https://www.buzztouch.com/files/howtos/Signing_Android_Apps_v1.0.pdf hope this helps, let us know if it doesn't. Cheers! -- Smug
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/23/13 09:36 AM (10 years ago)
Hi..SmugWimp Thank you for your quick reply. I will go all over this again an let you know the results. Cheers!
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/23/13 02:23 PM (10 years ago)
Hi Cant make it work having the same problems after add Google-Play-Services in to my project the google-play-services-remove.jar is missing from the libs file and the code looks like that in AndroidManifest.xml: https://dl.dropboxusercontent.com/u/6888551/applications/google-play2.png <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxxxxxxxx" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8"/> <!-- required device permissions --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <!-- Google Cloud Messaging permissions --> <permission android:name="com.cyououtandroid.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="com.cyououtandroid.permission.C2D_MESSAGE" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="android.permission.WAKE_LOCK" />      <uses-permission android:name="android.permission.VIBRATE" /> <!-- recommneded device features --> <uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <uses-feature android:name="android.hardware.location" android:required="false" /> <uses-feature android:name="android.hardware.location.gps" android:required="false" /> <uses-feature android:name="android.hardware.telephony" android:required="false" /> <application android:name="cyououtandroid_appDelegate" android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar"> <!-- activity root is the default, beginning activity --> <activity android:name="BT_activity_root" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" android:excludeFromRecents="false" android:noHistory="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!-- Google Cloud Messaging permissions --> <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="com.cyououtandroid" /> </intent-filter> </receiver> <service android:name=".GCMIntentService" /> <!-- activities for general layout (tabbed or non-tabbed) --> <activity android:name=".BT_activity_base" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_activity_root_tabs" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <!-- remaining activities are for individual plugin types --> <activity android:name=".WB_screen_menuImage" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".Das_video_playlist" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_customURL" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_splash" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_settingsLocation" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_customHTML" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".Rd_simplerss" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_map" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".Tm_invisiblefacebook" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_blank" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".JC_AlertView" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_menuListSimple" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_settingsDevice" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_wordDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_settingsLogIn" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BTA_audiostreamer" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_htmlDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_pdfDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_menuButtons" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_excelDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <!-- THE NEXT LINE IS ONLY USED IF MAPS ARE USED --> <uses-library android:name="com.google.android.maps"/> </application> </manifest>
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/23/13 03:23 PM (10 years ago)
Hmm. When was this package downloaded? You might try downloading a fresh package, just in case. Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/23/13 06:04 PM (10 years ago)
Looks like the old android code right? I went through all this some days ago but with the V3 Android Version. If that is an option for you, download the new source code and give it a go. Will help if you get stuck with that.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/23/13 07:00 PM (10 years ago)
Oh right; hadn't thought of that. in the old android, you'll want to use a v2 key, but follow GoNorthWests v1 tutorial... or download a v3 Android package. Nice catch, Leon :) Cheers! -- Smug
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/24/13 03:12 PM (10 years ago)
Thank you guys for trying helping me. Have redownload the package I have download android v3 via android sdk manager. Question!! where can i see if the android v3 is in my sdk? I still don't see any change in androidmanifest.xml.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/24/13 03:15 PM (10 years ago)
With Android 3.0, we mean the sourcecode you download from your server. You can choose to download the new code or the old code as you prepare your package for download. Nothing to do with SDK´s. Look closer at the button before you download your sourcecode, you will see the option!
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/24/13 03:15 PM (10 years ago)
Thank you guys for trying helping me. Have redownload the package I have download android v3 via android sdk manager. Question!! where can i see if the android v3 is in my sdk? I still don't see any change in androidmanifest.xml.
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/24/13 06:12 PM (10 years ago)
Sorry.. totally miss understand. Ok i have download the android v3 package Have add Google Play Services Project in Eclipse Workspace Have install Google Play Service in to my project Have past the v2 api in androidmanifest.xml file Have delete the google-play-services-remove.jar from libs file. And having these errors: The type android.app.Fragment cannot be resolved. It is indirectly referenced from required .class files BT_screen_map.java /xxxxxxxxxx/src/com/xxxxxxxxx line 1 Java Problem error: Error: No resource found that matches the given name: attr 'android:windowActionBar'. themes.xml /xxxxxxxxx/res/values line 12 Android AAPT Problem error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo.Light'. themes.xml /xxxxxxxxx/res/values line 11 Android AAPT Problem error: Error: No resource found that matches the given name: attr 'android:windowActionBar'. themes.xml /xxxxxxxxxx/res/values line 6 Android AAPT Problem error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo'. themes.xml /xxxxxxxxx/res/values line 5 Android AAPT Problem Attribute minSdkVersion (11) is higher than the project target API level (8) AndroidManifest.xml /xxxxxxxxxx line 1 Android ADT Problem The project was not built since its build path is incomplete. Cannot find the class file for android.app.Fragment. Fix the build path then try building this project xxxxxxxxxx Unknown Java Problem
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/24/13 06:24 PM (10 years ago)
Make sure you have the correct Android API in your environment (Eclipse Menu bar -> Window -> Android SDK Manager) Also, you may want to 'clean' your project (Eclipse Menu bar -> Project -> Clean...) And of course, ensure you're referencing the correct APi/SDK (Project Properties -> Android -> Android build target [should reflect 'Android' 4.0/API 14). I end up cleaning my project a LOT, lol! Cheers! -- Smug
 
yenael
Aspiring developer
Profile
Posts: 100
Reg: Sep 17, 2013
Detroit
2,950
like
09/24/13 06:46 PM (10 years ago)
Google Maps has deprecated the google Maps API Ley from the tutorial on buzztouch. We can use v2 with no problem right? Does it still use the Debug and research features? My app when installed shows a phone with clouds above it and a red circle. I know I don't have a key by now, I just want to make sure that that is the reason that shows up when I click the Location Map plugin.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/24/13 06:55 PM (10 years ago)
I haven't tested a v2 key on 'the old' buzztouch android... Only testing will tell. However, when you do, remember to keep the 'debug/release' keys straight as per GoNorthWest's document: https://www.buzztouch.com/files/howtos/Obtaining_a_Google_Maps_API_Key_v1.0.pdf In 'the new' BT Android there doesn't seem to be a difference; one v2 Google API key for either debug or release. Cheers! -- Smug
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/24/13 07:18 PM (10 years ago)
After seting the correct android api all the errors disappears, but no map is showing getting grey color with no pin on it. Have this red lines in Logat: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/24/13 07:31 PM (10 years ago)
Well... you know... check your project configuration to ensure that the resources are included ;) It sounds like it's not finding the Google Play Services... Make sure you can see the Google Play Services project in your Eclipse 'workspace' project explorer window, and make sure that the Google Play Services are referenced in your Project Properties. Also ensure Google-Play-Services-remove.jar is removed. https://dl.dropboxusercontent.com/u/115208762/GPS_Android.png Also, I noticed if you update your Google Play Services, you have to do the whole thing over again. So, if you recently updated Google Play, then check to ensure you still have a 'green' check mark by your Library reference in preferences... otherwise redo it, and you should be good. We hope. Cheers! -- Smug
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 10:21 AM (10 years ago)
Hi SmugWimp hope you have some more patience and try to help a beginner like me with no experience on app developing. I wass looking around this forum and others but good not find a solution for my problem. (The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.) I have delete the project and download it again download google pally added in my project Remove 'google-play-services-remove.jar' from my project. Past the API v2 key in manifest.xml. from google api console servises enable Google Maps Android API v2. (You said: check your project configuration to ensure that the resources are included ;)) Can you please provide me how configuration must be look like in my project? Thank you...
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/26/13 12:44 PM (10 years ago)
Smug pointed that out already: https://www.buzztouch.com/files/howtos/GPSRefBT.pdf Doublecheck if you have everything like in that file!!
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 02:21 PM (10 years ago)
Hi LeonG I have doublecheck i don't think miss something.. Please have look to the pict.. https://dl.dropboxusercontent.com/u/6888551/applications/and%202013-09-26%2C%2011.54.46%20%CE%BC.%CE%BC..png https://dl.dropboxusercontent.com/u/6888551/applications/and-09-26%2C%2011.57.58%20%CE%BC.%CE%BC..png I have only a samsung s3 mini availabul to test my app.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/26/13 02:25 PM (10 years ago)
Hmm ok. Can you show me a screenshot of your Java build path in the properties? The "Order and Export" part. I missed a mark there as I had problems.
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 02:40 PM (10 years ago)
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/26/13 02:44 PM (10 years ago)
no it is under "properties" as you rightclick your project name for example.
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 02:48 PM (10 years ago)
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/26/13 02:54 PM (10 years ago)
Yeah thought so. Click on the android 4.0 as well. save, clean your project and try it again, maybe your problems are solved.
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 03:03 PM (10 years ago)
No, did not solve the problem..
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/26/13 03:04 PM (10 years ago)
What does the logcat say now as soon as you click on your map tab
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 03:08 PM (10 years ago)
This is in red. The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/26/13 03:21 PM (10 years ago)
Pretty clear something with Play Services is still wrong then, but cant think of any further things to help you. Not sure if the map works on an emulator, or are you trying on a real device?
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 03:26 PM (10 years ago)
I'm on real device samsung galaxy s3 mini. pff.. I don't know what else to do. I will try with a new appi key.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
09/26/13 03:30 PM (10 years ago)
https://dl.dropboxusercontent.com/u/6888551/applications/and%202013-09-26%2C%2011.54.46%20%CE%BC.%CE%BC..png did you press on OK or APPLY after this screen? Have to press on OK, just in case you accidentally pressed apply. Running out of ideas.
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 03:38 PM (10 years ago)
No it was ok.. for to be sure i did press it again.
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 03:39 PM (10 years ago)
No luck..
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 04:21 PM (10 years ago)
My debug.keystore file is unreadebul.
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/26/13 07:54 PM (10 years ago)
No success exactly the same problem.. Have delete Eclipse and the hiden files, redownload Eclipse, have follow all the how to pdf.. the app buld with no errors but no map shows up. I think i will give up with android.. Thanks anyway..
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/27/13 07:39 PM (10 years ago)
I just take a look to my project today and see something strange in LogCat: (Ensure that the following correspond to what is in the API Console: Package Name: com.xxxxxxxxx, API Key: AIzaSyCsXXXXXXXXXXXXXXXXXXXXXXXLZYdXr8, Certificate Fingerprint: DF6E6ECF6BXXXXXXXXXXXXXXXXXXXXXXXX0F2E5 ) Name is raid, Api Key is raid, Certificate Fingerprint is wrong i have never use this Certificate Fingerprint. So i create a new Certificate use the SHA1 Fingerprint to create a new Api key past in manifest.xml In LogCat now i have new api key but no new Certificate Fingerprint, the Certificate Fingerprint is the same like before. Is that Normal?
 
S-George
Apple Fan
Profile
Posts: 111
Reg: Jan 18, 2012
location unknow...
4,460
like
09/30/13 06:10 PM (10 years ago)
My maps are working perfect.. I start with a new package download new workspace new api key.. and it works.. Thanks again...
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/30/13 10:35 PM (10 years ago)
Not sure what the problem might have been, but I'm glad you've got it working! One less thing for you to worry about now :) Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
10/01/13 02:28 AM (10 years ago)
Perfect
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.