Android emulator map is not visible - android

I have added a MapView element in my android project. The project is not showing any error, but when i run the application on my emulator (Google API 2.2), the map isn't visible. Instead only the grid lines are seen. The DDMS is giving me "java.net.UnknownHostException: android.clients.google.com" exception. I have already added INTERNET permission in my application.

You have to get a Map's API key from google to see the map.
http://developer.android.com/guide/tutorials/views/hello-mapview.html
In this link there is described how to use the mapview.

Same thing happened to me: I followed the tutorial, opened the application, and all I got was grid lines. In my case, my computer was attached to working internet, but my Android device was attached to a network that had become broken.

Related

android GPS location doesn't work?

I'm new to android development and I tried 2 tutorials to get the current location but neither of them work for me. I get the exact expected layout but instead of showing the location, it appears to be totally blank as if the command that sets the text field doesn't exist. The logcat doesn't show any exception that's why I didn't post it. Everything else looks normal.
I thought it might be something related to the permissions that must be ran in realtime starting from android 6.0 but this tutorial that I've tried deals with that issue, besides doesn't the lack of permissions throw a security exception ?
Here are the two tutorials that I've followed exactly as they are:
http://demonuts.com/2016/12/30/get-current-location-android-studio/
http://www.viralandroid.com/2015/12/how-to-get-current-gps-location-programmatically-in-android.html
For maps to working you need to put google_maps_key into google_maps_api.xml which is under values folder. You get this key in google api manager.

How do I render a map activity on android studio

I'm very, very new to Android and am currently trying to develop an app dealing with location. I want to start off on a map activity but after the first few times of rendering it correctly, it started giving me unrendered frangments and a rendering error. Pls Help.
Use the MapActivity provided by google in android studios.
Also make sure you have entered correct API key.
You can use this default activity on Android Studio.
Then, make sure you have an API key from google. Here's the link:
https://developers.google.com/maps/documentation/android-api/signup
After that:
Note: Always make sure that you are connected to the internet for the maps to render. Hope this helps!

Here android sdk sample code showing blank screen

I have downloaded here android sdk 90 day eval.
Tried to run the basic map sample application, but getting blank in the map frame.
I am able to see hello world text.
Seperately i also have here maps app running on my mobile, which runs without any problem.
I have my internet connection and location settings on.
Any help?
Have you included the app_id/app_code and lisence key(if you are using the premium edition) in your maifest file, as mentioned here :
https://developer.here.com/mobile-sdks/documentation/android/topics/credentials.html
Otherwise try debugging your app by adding a break point in the mapFragment.init() method , for example using the code on following link , try putting a break point on the line
(error == OnEngineInitListener.Error.NONE)
to check if there is any error.
https://developer.here.com/mobile-sdks/documentation/android/topics/app-simple.html

Why does my android app shows google map with small boxes over the map?

I am working on an android app. It was working correctly before but then I had to re-install my machine and I lost my debug.keystore. So I generated a new api key for the new debug.keystore but now I see map but with small grey boxes over the map. Any idea why this is happening and how to get rid of these boxes? BTW I am developing on a linux machine, Ubuntu 10.04 to be exact.
Did you edit the .xml file with the maplayout?
And this might be caused if you have the
mapView.setStreetView(true);
in your code, From my reading this is a bug in the Google Maps API Also if you didn't set the street view to true or any other view you should try setting it to false because i think it sets it to true by default.. But i recomend experiment little with the three views see which ones that gives you the white boxes and which ones that can be activated together and which ones that cannot..
Here is the three views if you want to experiment:
mapView.setStreetView(true);
mapView.setSatellite(true);
mainMap.setTraffic(true);
The common suggestion that I have got is to dont use setStreeView(true) and setSatellite(true) together. Some have even suggested not to use setStreetView(true) altogether. But my code was working okay before. I had to reinstall my machine and therefore installed android SDK and other components afresh. So my guess is that this is an issue with some specific version But I have found out that this problem occurs specific revision of 2.2 - in my case Android SDK Platform 2.2, revision 3. I have tried running same code on 2.3 and it works correctly i.e no grey boxes.

Android "Hello, MapView" Tutorial - Map Tiles Do Not Load

I am new to Android software development and new to this site. I am hoping someone might have some experience with the problem I am having.
I've been following the Hello, MapView tutorial in order to not only learn the Android framework, but also the Google Maps library. I've tried my best to implement things exactly as the tutorial has instructed. My problem is that the application does load in my emulator (or even on my phone for that matter), but the map tiles do not load.
Searching Google I found a post by someone else on another site having the same issue, but his/her problem was that the important elements added to the AndroidManifest.xml file were not in the right order. I double-checked this in mine, but everything seems to be right.
So, I am not sure what the issue is and was hoping others have seen this before. I can provide any snippets of code, if that would help.
Thank you.
Non-loading tiles are usually the result of not having the API key set up correctly. Obtaining a Maps API key
To answer the response you left to d.: If you want to have it "just work" when you run from Eclipse you'll need to get an API key for your debug certificate. There's instructions on the same page as before. Do note that you'll have to swap back to your other key before publishing though.
I am guessing the issue is not that you have an incorrect map key, but that you do not have the proper keystore setup. The application needs to be signed by the same keystore you used to generate the map key. You've noted that you can get it to work when you sign the application yourself, but you need to setup a debug keystore in order to use the Maps API with regular Eclipse builds.
All Eclipse builds require a debug keystore; you just normally don't notice it because ADT generates one for you automatically. You should either follow the directions here and create your own debug keystore, or you should take the debug key that ADT automatically created for you (it'll show you where it created it in Windows > Preferences > Android > Build) and sign up for another Maps API key. That key will work with Eclipse.
(P.S., this does make it a hassle to compile for release, as you need to switch your key back and forth depending on the signing keystore.)
I had the issue of tiles not loading as well. As you mentioned your original post, one possibility is with the ordering of elements in the AndroidManifest.xml file. Specifically, I originally had the line:
<uses-permission android:name="android.permission.INTERNET" />
after the application element. Once I moved this line before the application element, my map tiles started loading again.
The tiles not loading is almost always a result of using an inaccurate API-key, i think. Have you checked yours?
Details: Obtaining a Maps API key
I had the same problem... my error was in the manifest file puting INTERNET permissions inside application. After moveing it out (upside) everying was working good.
Make sure you have 3g on the top panel. If you don't then there is no internet connection. Sometimes I have to turn the emulator on and off a couple of times to get 3g to come up.
d. is probably correct. However, Internet problems will also cause similar symptoms. Be sure that your INTERNET permission is properly positioned and that there are no proxy servers/firewalls impeding access to the Internet.
Another problem could be a proxy that you are behind. The proxy slows things down a lot and it will effect your app even though the maps app and internet browser in the emulator work fine.
This is old question, but here is one more answer: if you are as hasty as me, you might accidentally copy the finger print code instead of API key from the web page :)
The Hello, MapView tutorial your were talking about is no longer valid. New V1 map applications can no longer be done.
Follow https://developers.google.com/maps/documentation/android/ for Google Maps Android API v2 applications.

Categories

Resources