Discussion Forums  >  Maps, Device Location, Tracking

Replies: 22    Views: 219

SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
04/02/13 03:21 AM (11 years ago)

Google Maps API v2

Hi there, I want to use Google maps, but it isn't possible to get an API v1 key. Is there any documentation how to use the API v2 or is there a pluging available that make use of the API v2 key ? Thanks, Edwin.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/02/13 04:55 AM (11 years ago)
V1 is still available. I just used it yesterday. Here's the link: https://developers.google.com/maps/documentation/android/v1/maps-api-signup
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/02/13 09:32 AM (11 years ago)
I'd grab one while you can! Sooner or later they're gonna shut that down for good. I do know that @David is working on the new maps stuff, but no idea when it'll be ready. Mark
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/02/13 09:37 AM (11 years ago)
agreed - according to the link I posted above, it should have shut down on March 18th I believe. Looks like they've extended us some grace, but no telling how long that grace will last.
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/02/13 11:06 PM (11 years ago)
Strange, When I try to get the MD5 fingerprint from the commandline, I've got this: androiddebugkey, 4-jan-2013, PrivateKeyEntry, Certificate fingerprint (SHA1): 06:63:DF:78:48:8C:B7:68:93:B7:C5:34:F2:08:7D:xx:xx:xx:xx:xx (last letters/numbers replaced by xx) It seems like an SHA1 key, but Google want's a MD5 fingerprint. I've followed the PDF instructions from GoNorthWest, so am I doing something wrong?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/02/13 11:14 PM (11 years ago)
Yeah, I think I need to update that doc a bit! Use the -v option in the keytool command, and it should give you MD5, SHA1, and any others. Even easier is to use the Keytool Plugin for Eclipse. Here's a video that shows how to make that work: http://www.youtube.com/watch?v=IaXE2FUENFI Mark
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/02/13 11:47 PM (11 years ago)
Thanks, I will try this when I'm finnished working today.
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/03/13 10:47 AM (11 years ago)
@GoNorthWest I've installed the keytool plugin and get an API key from Google. I've put this key in the xml file (googleMapsAPIKeyRelease) and build the project. (with my releasekey off course) Then I've installed the apk file on my phone and try to get the maps working, but I don't get the map, only a grey field with a pin. I assume the pin will reflect the lat/long that I put into the "location map" screen. Am I doing something wrong again ?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/03/13 10:58 AM (11 years ago)
Hmmm. That should work. As long as you used the same release key that you used to generate your googleMapsAPIKeyRelease key, and that is in the strings.xml file, then you should be OK. Make sure you check that the following is set in your screen_map.xml file (res > layouts): <com.google.android.maps.MapView android:id="@+id/mapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="@string/googleMapsAPIKeyRelease" android:clickable="true"/> Let me know if that's all good. And, of course, make sure that your device has a network connection. Mark
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/03/13 11:21 AM (11 years ago)
this is my screen_map.xml, and it seems ok to me. I have a wifi connection. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerView" android:background="@android:color/transparent" android:layout_height="fill_parent" android:layout_width="fill_parent" > <com.google.android.maps.MapView android:id="@+id/mapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="@string/googleMapsAPIKeyRelease" android:clickable="true"/> </LinearLayout>
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/03/13 11:27 AM (11 years ago)
Yep, so far so good. Now I'm wondering if, since you just got the v1 API key, and it's supposed to be deprecated, if they're actually no longer allowing use of it. Is there anything in LogCat when you try to bring up the map? You might have to connect your device to Eclipse first.
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/03/13 11:44 AM (11 years ago)
Well I've tried to connect my device to eclipse, but it doen't work. I set the debug in my phone to on, but it can't connect to the phone. Can I try it with the virtual device? If so, where can i find the log.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/03/13 11:47 AM (11 years ago)
On my YouTube channel there's a video on adding View to Eclipse. That shows how to get LogCat enabled. Connecting the device to Eclipse seems to be hit or miss. You might need to install the drivers for your device if you're using Windows. If you use the emulator, you need to get a debug API key for maps, based on your default.keystore. Mark
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/03/13 11:49 AM (11 years ago)
Ok, I will give this a try tomorrow Thanks for all your help so far, this is a great piece of open source !!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/03/13 02:03 PM (11 years ago)
Hang in there! I assure you the map stuff works (at least from a buzztouch perspective), unless Google has restricted something based on the new API. Either way, we'll figure it out. Mark
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/04/13 10:32 AM (11 years ago)
Mark, I've been using the android simulator from Eclipse and LogCat gives me the following entries: 04-04 17:25:04.217: W/ZZ(303): BT_screen_menuListSimple:handleItemTap loads screen with itemId: "7B87D6DE13D59E23F675401" 04-04 17:25:04.217: W/ZZ(303): BT_application:getScreenDataByItemId with itemId: = "7B87D6DE13D59E23F675401" 04-04 17:25:04.228: W/ZZ(303): BT_application:getScreenDataByItemId with itemType: "BT_screen_map" with nickname: "map2" 04-04 17:25:04.228: W/ZZ(303): BT_act_controller:loadScreenObject for screen with itemId: "7B87D6DE13D59E23F675401" and itemNickname: "map2" and itemType: "BT_screen_map" 04-04 17:25:04.687: W/ZZ(303): BT_screen_menuListSimple:onPause (BASE CLASS) 04-04 17:25:05.107: W/ZZ(303): BT_screen_map:onCreate 04-04 17:25:05.130: W/ZZ(303): BT_viewUtilities:updateBackgroundColorsForScreen with nickname: "map2" 04-04 17:25:05.130: W/ZZ(303): BT_viewUtilities:updateBackgroundColorsForScreen: setting background color to: "#FFFFFF" 04-04 17:25:05.130: W/ZZ(303): BT_viewUtilities:getNavBarForScreen building nav. bar for screen with nickname: "map2" 04-04 17:25:05.690: D/dalvikvm(303): GC_FOR_MALLOC freed 18257 objects / 1237528 bytes in 127ms 04-04 17:25:06.617: D/dalvikvm(303): GC_FOR_MALLOC freed 24939 objects / 1632792 bytes in 118ms 04-04 17:25:07.117: W/ZZ(303): BT_screen_map:onStart using data from app's configuration file 04-04 17:25:07.117: W/ZZ(303): BT_screen_map:parseScreenData 04-04 17:25:07.167: W/ZZ(303): BT_screen_map:showMapPins 04-04 17:25:07.167: W/ZZ(303): BT_screen_map:showMapPins 04-04 17:25:07.317: I/MapActivity(303): Handling network change notification:CONNECTED 04-04 17:25:07.317: E/MapActivity(303): Couldn't get connection factory client 04-04 17:25:08.567: W/ZZ(303): BT_screen_menuListSimple:onStop (BASE CLASS) 04-04 17:25:17.388: D/dalvikvm(303): GC_FOR_MALLOC freed 17739 objects / 1752608 bytes in 125ms It's not all, but I've chose the entries that has something to do when I'm launching maps. Also I've put my apikeydebug and apikeyrelease in strings.xml. I've set the androidmanifest.xml to false, but it won't even show up in the Android simulator. Any ideas, otherwise I have to wait until there is a plugin for Maps 2.0
 
SGB
Android Fan
Profile
Posts: 56
Reg: Mar 26, 2013
Goes
1,160
like
04/05/13 09:50 AM (11 years ago)
Yes, it's working. I think Google had to sync the key or so, but now it's working fine. Thanks for all your help. Edwin.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/05/13 09:53 AM (11 years ago)
Awesome! Good to know that new v1 keys are functional. Could have been a problem with something on Google's end. Either way...glad it's working! Mark
 
Icion
Aspiring developer
Profile
Posts: 43
Reg: Apr 14, 2013
Durban
10,980
like
04/19/13 01:17 PM (11 years ago)
API v1 has been discontinued. Can't seem to get a key from Chris's link. Should we move over to v2? As well, how do I get my eclipses console/terminal. I initially thought it was Windows CMD but the keytool message doesnt work. Any advice? Abrie
 
Markus
Aspiring developer
Profile
Posts: 1
Reg: Apr 08, 2013
Gilbert
10
like
04/19/13 02:05 PM (11 years ago)
Yeah, I haven't exactly been able to get my hands on an API V1 key, and would love so use Maps in my application.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/23/13 01:33 PM (11 years ago)
Mark - is there an ETA for getting the map updated to work with v2?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/23/13 01:34 PM (11 years ago)
I bugged David about this last night...he knows it's a high priority, but has not given me an ETA yet.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/23/13 01:35 PM (11 years ago)
Ok thanks
 

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.