1

For a school project we're building an app that uses Google Maps Api. We're getting this project to run, but the location and the map won't show (see picture).

The image is uploaded on mediafire, you can see it on with the following link: http://www.mediafire.com/view/?tioqsheq0pqr6jc

(PS: we also tried osmDroid, but the same thing happens.)

With iOS programming you can simulate a certain location. How can you do that with Android? The only information that I've found is to create a telnet session with the emulator to provide with longitude and lattitude. But that isn't working either.

Thanks in advance. Martijn

EDIT I've already read the post: StackOverflow other link

But it offers the same solution with telnet, but I'm wondering is there another way

Community
  • 1
  • 1
Martijn Haex
  • 137
  • 1
  • 11
  • I cannot access the picture, but that might be a problem of the proxy in my office ... Did you grant the permission to receive mock location? Are you using Eclipse? There is some functionality to send a location integrated. – Stefan Oct 18 '12 at 16:37
  • I'v tried to access it on my other laptop, and no problem there. But I'll explain what you can see in the picture. The app starts, and the grid with the logo off Google shows but the original map won't be displayed. So an empty grid is shown. My guess is that the problem is that it doesn't get any longitude or lattitude details. – Martijn Haex Oct 18 '12 at 16:40

1 Answers1

0

To be able to use/view the Maps API, you need to get an API key: https://developers.google.com/android/maps-api-signup

You also need to add the following in your manifest:

<uses-library android:name="com.google.android.maps"/>
<uses-permission android:name="android.permission.INTERNET"/>

For the second part of your problem regarding mock locations, you can use DDMS.

  • Thank you for answering my question. For the first part of your solution, I already did that (I forgot to mention that). And the second part I'll try and search on that sometime tomorrow or in te weekend. If it works I'll as an answer, else I'll post my difficulties. Thanks again. – Martijn Haex Oct 18 '12 at 17:16
  • I edited my answer. Have you added the necessary permissions? – Rod Michael Coronel Oct 18 '12 at 17:19
  • I've added the permissions offInternet Connection is needed and also the library (com.google.android.maps). – Martijn Haex Oct 18 '12 at 17:21
  • Are you sure that the API key you are using is correct? Can you try regenerating the API key in the link above? – Rod Michael Coronel Oct 18 '12 at 17:26
  • 1
    The API key by the way is machine specific. So if you get an API key using your certificate's MD5 fingerprint in one machine and you use the same API key in another machine, it will not work. "If you use different keys for signing development builds and release builds, you will need to obtain a separate Maps API key for each certificate. Each key will only work in applications signed by the corresponding certificate." – Rod Michael Coronel Oct 18 '12 at 17:28
  • Oke I'll take note off that. This information could save us time, cause we're (going) to work with three people on the same project with GIT. – Martijn Haex Oct 18 '12 at 17:45
  • If you are using Eclipse with ADT plugin, there's a perspective called DDMS that allows you to send mock GPS co-ordinates to the emulator. You must also enable the development option in the emulator to accept incoming mock locations (Settings -> Apps -> Development). Next, make sure your API key is for your machine just like Rod stated. Each of your teammates will have to create their own maps API key by using the debug keystore found on their machines and use that when they have to work with the map. – praneetloke Oct 18 '12 at 18:06