open street maps (osmdroid) shows grey tiles not map in PC
Asked Answered
K

1

5

I am using osmdroid to get open Street maps in my app. I had build my project with the needed jars (osmdroid) and added all needed permissions in the manifest. But when I try to debug my app in android emulator (adt eclipse) I am not able to see the map, only grey tiles. My project is working fine because if I debug in a smartphone I am able to see the map, the problem is only with the emulator.

I have done some research but I only found information of google maps solutions but not open street maps (osmdroid). Does somebody know how to solve this issue?

this is how I show the map in xml file

<org.osmdroid.views.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="322dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true" >

        </org.osmdroid.views.MapView>

this is my main activity

mapView  = (MapView) findViewById(R.id.mapView);
    mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
    mapView.setBuiltInZoomControls(true);
    mapView.setMultiTouchControls(true);
    mapView.setUseDataConnection(true);

These are my permissions in manifest:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" >

and the jars added to my build path

osmdroid-android-4.2.jar
osmdroid-thrid-party-4-2.jar
slf4j-1.7.7.jar
Krenn answered 9/7, 2014 at 13:30 Comment(7)
Props for using OSM rather than Google! A lot of issues on their GitHub page seem to regard Maven. Are you using Maven in your project?Spermous
Does the emulator have a network connection?Corked
yes it does, I have even added a proxy to the emulator if that was the problem, but I am still experimenting this problemKrenn
Can you access the Internet via the web browser on the emulator?Perplexed
Yes I do. I am sure it is not a network connection problemKrenn
Could your problem be the same as this? #14060889Rumble
actually @Rumble , that was my problem. I added a SD card to my emulatorKrenn
K
7

I created an emulator with SD card and that solved the problem

Krenn answered 9/7, 2014 at 19:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.