Discussion Forums  >  Maps, Device Location, Tracking

Replies: 36    Views: 258

Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
05/25/14 01:40 AM (9 years ago)

Step by step_Android maps

This thread is meant to be a "step by step" description of the steps that you must do to get the maps to work on Android. Very good information can be found on BT (and from the members) but everything is not up to date and sometimes confuses the whole process for us "newbies". The idea is to keep it simple (step by step with short descriptions) and up to date when ever changes are coming up in the process. I hope that anyone who has knowledge and advice can contribute.
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
05/25/14 02:48 AM (9 years ago)
Having been through the mill with this one - I confess I'm deflated that the Driving Directions doesn't actually work (broke in BT3 apparently)? So - once you have Maps actually working, all you have are callout markers displayed on the map - nothing more nothing less. The existing PDF's to correctly configure google.play services and .jar are spot on, as are the instructions for obtaining and configuring the Google V2 key (debug and live) so no issues there. Start a clean project, and follow to the letter and it will work.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
05/25/14 03:22 AM (9 years ago)
Just FYI, the new version of the BT_screen_map 'should' have fixed the driving directions issue... I documented a fix in this post: http://www.buzztouch.com/forum/thread.php?fid=BC70C36A743CD4FAD95D17F&sortColumn=&sortUpDown=&currentPage=4&tid=5C35CEE04B197A01B3BCCC2&command=confirmDeleteThread and let Chris know; he updated the plugin recently. Try updating your project with a new plugin... Cheers! -- Smug
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
05/25/14 04:38 AM (9 years ago)
Hi SmugWimp - thanks for that, only started in on this yesterday so using latest everything reference plugin's. Using Android which I believe still has the issues? I have created an updated walkthrough in Micro$ Word with screen shots - end to end (API2 and project setup). Its an open doc so where can I push this for others to contribute/amend/add as required?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
05/25/14 04:55 AM (9 years ago)
Sadly there isn't really a 'wiki' that can be amended and corrected at will. Susan usually keeps the 'library' as fresh as possible. If you've got a 'finished' product, I'd forward it to susan@buzztouch.com If you don't mind snooping through the code, the problem with driving direcitons basically has to do with the new json value/key pair "calloutTapChoice" which will either be 'loadNextScreen' or 'drivingDirections' (or something close to it...) it's looking through all the old school choices (loadScreenWithItemId, loadScreenByNickname and loadScreenObject) which are still valid, but 'callOutTapChoice' needs to be edited in there to provide another option... The code is different on iOS and Android, but the concept is the same and will apply to both. Cheers! -- Smug
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
05/25/14 05:16 AM (9 years ago)
Hi Smug, yeah - I made all the changes as per post, commented out the deprecated lines ... no errors reported, exported apk and side loaded onto my Android phone, still the same - callout points only with no directions! Frustrating :(
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
05/25/14 05:25 AM (9 years ago)
hmmm.... I'll revisit my code... I got it to work in mine... so I must have missed something in the transcription... Cheers! -- Smug
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
05/25/14 05:30 AM (9 years ago)
Hi Smug, yeah - a man with your coding skills I imagine will lick it into shape :)
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
05/26/14 12:52 AM (9 years ago)
Any joy on directions?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
Fourm StarFourm StarFourm Star
like
05/29/14 04:15 AM (9 years ago)
Hi @shorewalk, in response to your original question a on step by step description of the steps that you must do to get the maps to work on Android, I've just finished going through the process for myself. I realise there have been a lot of questions in the forums on how to do this, so I documented it as I went along and posted it on dropbox, https://db.tt/IW2cowFh This is probably not the only way, but this way works for me. Give it a try and please, if anyone sees anything needs correcting or clarifying, let me know. Cheers, Alan
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
05/29/14 04:34 AM (9 years ago)
Got it nailed now but the Directions elements still doesnt work! This is a coding issue with the plugin as everythig is fine. For what its worth - my PDF on dropbox: https://www.dropbox.com/s/9a6vdpgpls86tma/GoogleMapsV2_Setup.pdf Oh the joys!!! Cheers, Rob.
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
like
05/29/14 09:15 AM (9 years ago)
Thanks Alan, Smug och Rob I think the step by step description makes life easier for many of us newbies. I will try the steps in the future. Right now, a new iOS project that must be completed first. "Walking by the shore, today"
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/03/14 12:03 PM (9 years ago)
Hello All, I am trying to get Location Map to work. I think I have done everything required to get Maps to work. Yet when I run/debug in Eclipse, I get failure to connect to Google server. I printed rburns50 document and will give it a try. Hopefully I will get it to work soon. If not I will be back.
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
like
06/03/14 12:34 PM (9 years ago)
Hi LTC_Barber I have not had time to try the steps yet...still working on a iOS project. Did you also implement the steps by Smug: https://www.buzztouch.com/files/howtos/googleapiv2.pdf
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
06/03/14 01:22 PM (9 years ago)
Also, don't forget there are issues trying to get this working through the emulator - use a real device! There are documented ways that you can apparently get the emulator to work but I havent bothered with them, just as easy to side load your APK onto a "live" device and test it out :)
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/03/14 09:58 PM (9 years ago)
Thanks for the response. I followed Smug's doc twice. In the documentation for Location Map, in the Strings.xml there should be entries for getAPIKeyDebug and getAPIKeyRelease. Both entries were missing, so I put them in. I set my Android device to debug mode and connected it. Started up the app and watched the Console. Every now and then I would see a message like "Error logging into Google Server" when the map screen would try to load. There would be a small popup - 1 locations without the map and no push pin showing. And all the other screens worked fine.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
06/03/14 11:37 PM (9 years ago)
API keys for Google no longer belong in strings.xml; the API v2 key should go in the AndroidManifest.xml file. https://www.buzztouch.com/files/howtos/googleapiv2.pdf pg 2/14 Cheers! -- Smug
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
06/04/14 04:43 AM (9 years ago)
Indeed, thats why I didn't put it in my crib sheet either! I would recheck your debug and live SHA1 keys against what you have configured in the API console, and then the allowed com.<NAME> fields for each just to make sure.
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/04/14 01:07 PM (9 years ago)
Thanks again guys I did put the API Key in the AndroidManifest.xml and there seems to be a connection problem. My test android device is a Galaxy Note 10.1. Would the Note cause a connection problem? I do have a problem perhaps because I don't know how to switch between debug and release versions if that is required with Maps V2
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
Fourm StarFourm Star
like
06/04/14 02:17 PM (9 years ago)
When you export your APK file, are you using a new keystore (one you created for the App)? If so, thats the one you need to register against
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
06/04/14 02:22 PM (9 years ago)
Also, if you're using your 'Release' key, be certain to set the 'debuggable' to 'false' as well... Cheers! -- Smug
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/04/14 02:52 PM (9 years ago)
Okay, I understand Release and Debug, but as a Database guy, I have never worked with Eclipse so I am missing the "where" debug and release are set. Also, when and where the Keystore is created. Trust me I think I can code. It is like learning German - Sometimes the many of the verbs are at the end of the sentence I have "Mein Kampf" in German
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/04/14 03:16 PM (9 years ago)
Thanks again guys I did put the API Key in the AndroidManifest.xml and there seems to be a connection problem. My test android device is a Galaxy Note 10.1. Would the Note cause a connection problem? I do have a problem perhaps because I don't know how to switch between debug and release versions if that is required with Maps V2
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
06/04/14 07:09 PM (9 years ago)
Changing the debug settings hasn't changed in any versions... In your package you'll have an AndroidManifest.xml I can't say which line number, because they vary depending on app, features, etc... Do a search for the following text: "android:debuggable" which should be part of a longer string in application settings that looks like this: android:debuggable="true" If you're using a 'release' key, then it should be set to 'false'. If you're using a debug key, it needs to say 'true'. It will not alter the logcat output; however true 'debugging' is disabled. It's advised to make these changes at the end of your project cycle, so that any issues would have been worked out, and changes can be made just prior to app release. On page 10 of my google api tutorial, there is a section called: Forget Waldo. Where is my debug and release keystore kept at? Which should explain the location of your debug keystore. If you don't know where your 'release' keystore is, then you probably haven't created it yet. My suggestion is that when you do create it, keep it in the same directory as your debug. Cheers! -- Smug
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/04/14 09:48 PM (9 years ago)
Thanks again Smug When I look in the .android folder in Windows, there is no debug.keystore! That is one of my problems
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/04/14 09:49 PM (9 years ago)
BTW Smug, Now I understand what Page 10 means Thanks
 
LTC_Barber
Veteran developer
Profile
Posts: 8
Reg: May 06, 2014
Mohave Valley, ...
4,430
Fourm Star
like
06/04/14 10:17 PM (9 years ago)
Here is the most important part: The SHA1 fingerprint for debugging (used on the google site) is the one found in the menu: Eclipse => Window => Preferences => Android => Build I put that one in API Access screen and my app worked. Really Thanks Smug and rburns50 for bearing with a newbee to Android and buzztouch. I will be writing plugins soon
 
Nicks App
Code is Art
Profile
Posts: 423
Reg: May 21, 2014
Las Vegas
5,980
Fourm Star
like
06/29/14 08:50 PM (8 years ago)
I got Location Map to work right away. Although, I didn't try driving directions. I'll keep this for future reference.
 
Nicks App
Code is Art
Profile
Posts: 423
Reg: May 21, 2014
Las Vegas
5,980
Fourm Star
like
07/08/14 06:14 PM (8 years ago)
@LTC_Barber Hi - I just worked through this for the second time in 30 days. As for the SHA1 code... I got the first SHA1 code from (OSX ADT bundle) Eclipse => Preferences => Android => Build . Put it in Google API console and got the API key. Put API key in AndroidManifest.xml. Clean. File > Export, got to the last screen and the SHA1 and MD5 were different! Finished exporting apk, got it on the device, and no map, no pins. Went back into Eclipse, walked through the File > Export again, got to the last screen with the different SHA1/MD5, edited Google API Console to that new SHA1... API key remained the same. Did the File > Export thing again, and the Map worked!!!!
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
like
07/15/14 02:49 AM (8 years ago)
I've just managed to get the Google map on my Samsung Galaxy Tab3 to show up. I used SHA 1 fingerprint via Eclipse (guess it's Debug fingerprint) and generated a key for Android applications via Google developer console. So far so good ... But I need to do it in release mode for later export. But I just dont succeed. How to generate a release keystore and implement it to my project? I tried to create a new with "Keytool". Did the process through Google developer account again: "Create Key for Android applications". When I replace the key obtained the map doesn't show up anymore (white map). Later on when i will try to export the "app". In Eclipse i will come to an dialogue box that says "Use existing keystore" or "Create new keystore" If i use "Keytool" in asume it produces what I need. I just dont find the keystore I have made. Smugs says If you don't know where your 'release' keystore is, then you probably haven't created it yet. My suggestion is that when you do create it, keep it in the same directory as your debug?" Need some assistance here...
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
07/15/14 02:56 AM (8 years ago)
"typically" your 'release.keystore' will (by default) set itself to save in your .android directory. On a mac, that's in your user 'home' directory. On the PC I would 'guess' it's somewhere in your user directory as well, but not specifically certain. The Keytool should also differentiate between your debug and release keystore... But again, if you're not 'sure' about your release keystore, then choose 'create new keystore' and name it 'release'. Save it to the same directory as your 'debug.keystore' (mostly for admin purposes, you can actually save it wherever you want, as long as you remember where it is...). You will be prompted to create a password. Make *sure* you never ever *ever* lose it, because if you do, you won't be able to sign any updates with the same keystore, which will force you to release a whole new app, rather than a version update, later in life. Also, In your 'AndroidManifest.xml' file, did you set 'debug' to false? Cheers! -- Smug
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
like
07/15/14 03:00 AM (8 years ago)
Yes, didn't work
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
like
07/15/14 03:45 AM (8 years ago)
"Save it to the same directory as your debug.keystore" When i create a keystore via Keytool in Eclipse, where to find this option to save it to a specific directory?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
07/15/14 03:47 AM (8 years ago)
Let me fool around with mine for a second and see... Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
07/15/14 04:24 AM (8 years ago)
Try this out and let me know how it goes... https://dl.dropboxusercontent.com/u/115208762/releasekeystore.pdf Cheers! -- Smug
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
like
07/15/14 04:30 AM (8 years ago)
Will try later this day. Thanks
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
Fourm StarFourm StarFourm Star
like
07/16/14 06:03 AM (8 years ago)
Thanks again, Smug I managed to get a map visible with pins and all. Both in debug and release. Little strange was that I had to enter a sub-title to make visible pins, but perhaps as it should be ...? Now remains to see if I can get the rest to work in same "style" as my iOS apps ... I have an app where I use your "Android HTML". The upright position is all good but the horizontal images become downsized ... I use CSS and everything looks great in the browser and on iOS apps. Any suggestions or links to the forum where this has been discussed?
 

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.