Discussion Forums  >  Maps, Device Location, Tracking

Replies: 2    Views: 329

DavidW
Android Fan
Profile
Posts: 1
Reg: Dec 03, 2015
London
10
12/03/15 06:16 AM (8 years ago)

Newbie Including Google Maps in 1st App

Hi All, I have created my first app and all looks good. I am trying to get a map but I have 1 of 2 problems. Either it just displays a blank white page. I have realised that this is because I am missing my API key. I have generated one with Google and added it to the AndroidManifest.xml in <meta-data android:name="com.google.android.maps.v2.API_KEY">. Now when I launch the app, it crashes when I load the map page. I have seen reference to changing the API from 21 to 14 but this also does not seem to help. Also I am unable to look up Long and Lat on the Location Map screen setup page. Whatever I enter in to the Sub-Title, when I tab out it says "working..." but never finds the Latitude & Longitude values. Sorry if this is something I am missing, David
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/03/15 06:52 AM (8 years ago)
Sometimes you can see something and go 'ah ha', and know what to say. Other times need more information. This is one of those times. ;) 1) If you're using the Android 'Virtual Device' (aka a Simulator) Maps don't show. Ever. You'll need a real device. 2) When it 'crashes' the logcat spews a million lines of stuff, mostly red. What you'll want to do is scroll up to where the 'black meets the red' and that's where you'll find what it was trying to do when it crashed. Those are the log entries we'll want to see. It could explain a few things. 3) Changing the API from 21 to 14 may not matter. It matters only to the target device. 4) I live on Guam, so the 'address to coordinate' algorithm never works for me anyway. I tend to go to sites such as http://itouchmap.com/latlong.html to get my coordinates. Let us know what the log says, and we'll have a better idea of what to look for. Cheers! -- Smug
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
12/03/15 07:52 AM (8 years ago)
Welcome to Buzztouch, @DavidW! Smug is absolutely spot on! If you need some help with debug and the like, I have a few videos on my YouTube channel that should help: https://www.youtube.com/user/gonorthwest Let us know the answers to Smug's question (he's the man...a great source of advice) and we'll get you up and running! Mark
 

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.