Using OSMDroid for Offline mapping in Android, step-by-step [Tutorial]

For my EnschedeLocator app, I wanted the users to be able to store an offline map on the device and see it while navigating to their destinations. In our BeerFinder project at NTNU last year, we were able to do this using Nutiteq’s android library, but poor documentation lead me to looking for other solutions. I discovered OSMDroid which is a library that aims to be an opensource alternative to Google MapView in Android.

Below, I will outline how I did it and how I solved some small obstacles i encountered. Note that there may be other and better ways of doing this, but this is what worked for me.

Tools needed

  • Eclipse with Android SDK (assuming you know the basics here).
  • Mobile Atlas Creator, for preparing map tiles.
  • OSMDroid library, available here. I used osmdroid-android-3.0.7.jar.
  • SLF4J Android library, available here. I used slf4j-android-1.5.8.jar. Without this library I got a NoClassDefFoundError when trying to run the app. Adding this library somehow fixed it [source].

Preparing the map

To download the map tiles I used Mobile Atlas Creator.

My steps were as follows, most settings are done in the options pane to the left of the map:

  1. Set atlas format to Osmdroid ZIP [Atlas – Convert Atlas Format].
  2. Set your map area coordinates, either by clicking and dragging on the map, or by setting min and max coordinates in the coordinate selection pane to the left.
  3. Set map source to OpenStreetMap Mapnik. Note: I originally set my source to something else, and the map wouldn’t appear on my phone. I’m sure there’s a simple fix for this, but haven’t looked into it yet.
  4. Select the zoom levels you want to include. This will impact the storage space required. As you select more levels, the number of tiles needed are displayed. Each pane takes about 20kilobytes. I included all levels because my area of interest is so small that I’m not to concerned about that yet, I might make small versions available when I publish the app. For my area, 178 tiles + 20kB = 3.48MB.
  5. In the Atlas Content pane, set the name of your map first, then click “add selection” (the name really isn’t important, though).
  6. Then select “Create atlas” and your map is stored in the atlas folder under Mobile Atlas Creator.
  7. Move the resulting zip-file to /mnt/sdcard/osmdroid/ on your device. (For a slight improvement in performance, you can unzip the file and move the resulting Mapnik-folder to /mnt/sdcard/osmdroid/tiles/ instead. The difference in size isn’t that big, but the zip-file might be a good way to organize different maps if you have several areas, but I digress).

That’s it for preparing the map! Again, these are steps and settings that worked for me, others might work better, but I haven’t researched them yet.

Importing the libraries to Android project

When I attach external libraries to my projects I put the .jar-files in the project folder so that I know where they are.

  • Move the osmdroid-android-3.0.7.jar and slf4j-android-1.5.8.jar (and osmdroid-android-3.0.7-javadoc.jar for documentation) into your project folder.
  • In eclipse, right click the project and click refresh, the files should show up.
  • Right-click the files and select [Build Path -> Add to Build Path].
  • Then, go into [Build Path -> Configure Build Path] and under the Libraries tab select the osmdroid.jar and edit javadoc location to the osmdroid-android-3.0.7-javadoc.jar file.

The code

This example code shows the map parts of the Activity class and should be enough to view the map. Note that this Activity doesn’t need to specify an .xml layout as we’re doing it in the code.

[code lang="java"]

import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;

import android.os.Bundle;

public class OSMDroidMapActivity extends Activity {
    public void onCreate(Bundle savedInstanceState){

        MapView mapView = new MapView(this, 256); //constructor
        setContentView(mapView); //displaying the MapView
        mapView.getController().setZoom(15); //set initial zoom-level, depends on your need
        mapView.getController().setCenter(new GeoPoint(52.221, 6.893)); //This point is in Enschede, Netherlands. You should select a point in your map or get it from user's location.
        mapView.setUseDataConnection(false); //keeps the mapView from loading online tiles using network connection.

This displays the MapView only. If you would like to add some other Views, you can remove the setContentView(mapView); and add the following to your class and remember to do the right imports.

[code lang="java"]
        TextView myTextView = new TextView(this);
        myTextView.setText("Enschede, Netherlands");
        Button myUselessButton = new Button(this);

        final RelativeLayout relativeLayout = new RelativeLayout(this);
        final RelativeLayout.LayoutParams mapViewLayoutParams = new RelativeLayout.LayoutParams(
        final RelativeLayout.LayoutParams textViewLayoutParams = new RelativeLayout.LayoutParams(
        		RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        final RelativeLayout.LayoutParams buttonLayoutParams = new RelativeLayout.LayoutParams(
        		RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);

        relativeLayout.addView(mapView, mapViewLayoutParams);
        relativeLayout.addView(myTextView, textViewLayoutParams);

Basically, we did three things here:

  • Create the TextView and Button.
  • Create the RelativeLayout and the rules for the different Views.
  • Add the Views to the Layout and finally set the Activity to show the layout.

Now we should get something like this:

  • Appreciate

    you have just done some of the very few good tutorials about osmdroid!
    I would like to congratulate you and keep it up!!

  • Appreciate

    Do you have any tutorials about adding points on a map or using locationlisteners to view device location with a marker on the map?

    • I might make one at a later time (I’m a little busy with school these days), but for LocationListener, I will refer you to For the marker you simply add a SimpleLocationOverlay:

  • Kelsie Zhao

    Thank you ! Great tutorial!
    Just one question. You mentioned “move the resulting zip file to sd card” after created manually. Is that possible to do that from code? I am building an app for some other guys, they may not want to add files manually……Please help!!

    • Thank you very much, Kelsie. 

      Yes, this is possible. You bundle the zip file with your app by placing it in the assets-folder. Then have a look at the CopyAssets() and CopyFile() methods here: 

      In my application, I called the CopyAssets in the onCreate method, checking if the file already existed. A better option might be to check if the file exists already, and if not, ask the user if the app should copy it there.

      It’s probably also possible to overwrite a class in OSMDroid to let it look for the map in the assets-folder in stead of the sd-card, but I haven’t researched this. If you do, please let me know how it goes.


  • mata

    hello… thank’s for your tutorial. it’s very helpful to me :)and i have one question for you :D.. is it possible to modify the map view like bird viewfrom a single point instead of viewing from above? example : 
    thank’s for the answer 😀

    • Hi! I don’t think that’s implemented in OSMDroid. If you find anything on it, don’t hesitate to comment about it here 🙂

  • MAKSumon

    Hello… thanks for the tutorial. But in my app no map showing… Help me…

    • Well, to debug that, some more information is needed. Did you perform all the steps in the tutorial?

    • MAKSumon

      Sorry… It’s working. I made the mistake while copying .zip from assets to the sdcard. Thanks a lot for the brilliant tutorial.

  • Sedghi Moradi

    Hello,thank you sooooooooooooooo muh for this tutorial,it was really helpful for me
    Be successful 🙂

  • Rorydunbar

    Hello, I am trying your tutorial. If I do not have an sd card where should I put the map file?

    Your help wold be greatly appreciated.

    • Hi, it’s not a physical, external SD-card, but the SD-card partition on your phone. I know it’s a bit confusing 🙂

      • Rorydunbar

        Yeh I’m an idiot lool. Trying to run before I can walk… I have went back and learnt the concerts i.e. overlays etc and now I am going to do this tutorial.

        Thank you very much for getting back to me!!

        Did you every create a GIT project for your app?

        • No worries, it’s a strange way to name that partition, I didn’t get it right away either. I’ll put it up on github when I publish it in Play Store, just haven’t gotten around to it. 

          • Rorydunbar

            Hi John,

            I have tired to get the offline map showing and I have problems. I have followed your instructions down to a tee. I had to make minor changes to your code as I got errors when copying. Can you see did my changes have a bad effect? I would really appreciate the help. 

            I have spent far too long at this. I have added the files to /sdcard/osmdroid/. I have changes the name of the .zip and unzipped folder to Mapnik and tiles but nothing seems to work. 

            Problem is I do not see the map. I don’t get any errors just grey squares. When I zoom out I see one tile of a section of the world. Can I hardcode a path?

            Any guidance would be appreciated.

            import org.osmdroid.util.GeoPoint;
            import org.osmdroid.views.MapView;import;import android.os.Bundle;
            public class map extends Activity { public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    MapView mapView = new MapView(this, 256); //constructor    mapView.setClickable(true);    mapView.setBuiltInZoomControls(true);    setContentView(mapView); //displaying the MapView    mapView.getController().setZoom(15); //set initial zoom-level, depends on your need    mapView.getController().setCenter(new GeoPoint(52.221, 6.893)); //This point is in Enschede, Netherlands. You should select a point in your map or get it from user’s location.    mapView.setUseDataConnection(false); //keeps the mapView from loading online tiles using network connection.}}

          • Is your GeoPoint(lat, long) correct? The one in this code is in Enschede, Netherlands, so if that is outside of your map area, it will not show. You can use Google Earth to find different values for your initial center.

          • Rorydunbar

            Sorry yes I put Ireland in 53.000, 7.000.

            I have been testing on my phone which is not good for debugging so I have pushed the to the /sdcard/osmdroid directory on the emulator and when I run on the emulator I get an error in the log cat “Error downloading MapTile”

            So it looks like its trying to connect to the internet… ??

          • Rorydunbar

            FYI, adding the internet permission fixed the error. I wiped the data in the osmdroid folder copied over the .zip file and when I run the application, a tile folder is created with only two folders and 4 .png files. Im confused.

          • Good to hear you figured it out.

          • Rorydunbar

            Sorry John I didnt get it working. I tried all the above and still no joy. I read an article that said MOBAC and Mapnik are not working together at the moment so I am going to try using Mapquest tiles. Does your tutorial still work, can you run the code?

          • Rorydunbar

            FYI you have to use MapQuest tiles not Mapnik tiles when using MOBAC to download. 

            Great tutorial BTW!! Guys like you are what the internet is all about.

          • Interesting, I’ll look into it when I have time (back to school).

            Thank you very much for your kind words 🙂

          • Archie

            I had the same problem when trying to use my phone in Debug mode. After searching for hours here is the solution I found:

            Basically you have to Select the “Touch for other USB options” and select Connect as Camera”… the other selections lock up the SD Card so all you get is grey tiles

  • Goldy567

    Can you draw an ellipse or cycle on the map?

    • This is possible, I would start exploring the OverlayItem class:

  • Dan A.S.

    Also works with other maps if they have the same directory structure and png format for images (exported as osmdroid zip).

    / sdcard / osmdroid /

    Inside the zip file:
    Mapnik /
          NN / (zoom levels)
              NNNN / (folder area)
                         xxxx.png (png images)

  • Rayiez

    For me It works fine on android4.1 but it shows empty map on android 4.0.
    Any ideas what can be the problem?

    • Not sure, pretty sure I’ve made it work with ics before (it’s what I was running while making my app). You should try running it while connected to eclipse (adb), so that you can get the debug messages.

    • Also, make sure the path to the folder of the map is correct.

  • Hi, I look your project very interesting. Thanks for this tutorial!!

    I just wanted to know, I that normal that there is no onCreate() function?

    • You’re very welcome, glad you liked it 🙂

      This example just inherits the onCreate from Activity:
      For more advanced applications, you may want to override it. 

  • Girish

    Hi John, Thanks for the detailed tutorial. I was searching for something like this.
    But when I tried doing the same myself, I don’t see the map images shown. Only the lines (vertical and horizontal) are displayed in white background. I have created the tiles using MOBAC and tried using both zip as well as Mapnik containing tiles to my phone /mnt/sdcard/osmdroid/ folder. Please let me know what could be wrong.
    My requirement is for an Android tile based preview alternative to CATileLayer in iOS to display large sized images with offline support as well. I need to load the tiles preview from server when internet exists, and when its not available, i need to load offline preview.

    Thanks a lot,

    • Hi! There are a number of small things that could be wrong, it’s been a while since I set this up myself, but it doesn’t sound like you’re getting an error. Check if your start center point is inside your map area:

      mapView.getController().setZoom(15); //set initial zoom-level

      mapView.getController().setCenter(new GeoPoint(52.221, 6.893));
      //This point is in Enschede, Netherlands.
      //You should select a point in your map or get it from user’s location.

      • Girish

        Thanks for the quick response 🙂 Let me check it and update here.

      • Girish

        Its working now. You pointed it out rightly. The center point was indeed the problem. Thanks a lot John.

  • Hi !

    I am trying to build your app but I am stuck with a very curious error:

    Description Resource Path Location TypeSyntax error, insert “}” to complete Block /BvTest/src/com/yourpackage/name line 17 Java ProblemSyntax error on token “{“, { expected after this token /BvTest/src/com/yourpackage/name line 13 Java ProblemSyntax error on token “)”, { expected after this token /BvTest/src/com/yourpackage/name line 18 Java ProblemReturn type for the method is missing /BvTest/src/com/yourpackage/name line 18 Java ProblemSyntax error, insert “}” to complete ClassBody /BvTest/src/com/yourpackage/name line 17 Java ProblemmapView cannot be resolved to a type /BvTest/src/com/yourpackage/name line 18 Java ProblemSyntax error on token “mapView”, VariableDeclaratorId expected after this token /BvTest/src/com/yourpackage/name line 18 Java Problem

    Did you run into this issue before, or maybe you could give me some tips?

    • You have to put everything between super.onCreate(savedInstanceState); and mapView.setUseDataConnection(false); in a method called onCreate(Bundle savedInstanceState). I see this was missing from the example, but I updated it now. Thanks for catching it!

  • Endi

    Hey John, great tutorial!! Some minor problems but managed to figure them out.
    I wanted to ask you, whether you have thought to use the button you create in the map, as a switch button, I mean from the offline mode to the online mode, supposing that you might want to retrieve a tile that was not originally in your zipped osmdroid file.This feature would be similar to the google maps offline functionality…please let us know, I am very interested

    • Thanks! Hope it was helpful 🙂 The button is meant as sort of a starting point for people to add their own functionality, maybe I should post this to Github and see if someone would fork it? The idea of offline/online mode is definitely useful, but I probably wont work on it too soon as I am busy with other projects at school.

      Don’t hesitate to let me know if you keep working on it, would love to see it 🙂

      • Endi

        I found out that there are some licensing problems, even with Osmdroid, they are not happy if you want to download their tiles on the go (I mean whenever the user selects an area of interest and then wants to go offline…this cannot be done, the only possibility is to have it prior downloaded on your sd card…but that’s not what i need :S) I think i have to find smth else for my project…was very enthusiastic about this idea, but cannot be done apparently, unless i want to create my own tile server 😉 

        • You mean to download the tiles directly on the phone? I don’t know how that would work, and I don’t know the details of the licensing issues.

  • David in SoCal.

    Would it be possible to post a tutorial about working with the overlays in OSM?  I’ve been looking very where, but the samples I find are all posted by people who have written the code and can’t get it to work… Thx, David

    • I don’t have any plans to make a tutorial on overlays at the moment. I am quite busy with other projects and school these days, but I’ll keep it in mind. Any specific topic on overlays in mind? The only “special” thing I remember doing, was to use a custom icon for the position icon.

  • Avegpatekar

    I do the the same thing as you mentioned in this tutorial but my appliaction isnot loading tiles from sd card  so it results in blank map view with zoomable control. Can u tell me any solution for this prob?

    • It’s a little hard to say exactly what could be causing this in your case. The first thing I would check is to see that your starting center point of the app is within your map area:

      mapView.getController().setCenter(new GeoPoint(52.221, 6.893)); //This point is in Enschede, Netherlands. You should select a point in your map or get it from user’s location.

      Otherwise, I would look through the comments here and see if any of their issues are the same as yours.

  • Pingback: offline google map with gps for android : Android Community - For Application Development()

  • do you know how to get an online mapwiew from openstreetmaps

  • Can anybody upload a working code here. Please.

  • Awais Bin Asif

    Hello, can you please tell me how to make an app with offline navigation using osmdroid api.

  • Gurucharan Vijayakumar

    Can we implement offline turn by turn navigation with this osmdroid?

  • Jim Petro

    We are trying to do something similar, we built a OSMDroid Zip file and the only way that it works is if it is in a folder named “Mapnik”. Our Zip file contains zoom levels 11 to 21, but we are only able to zoom from 11 to level 18. We are told it is because it is a mapnik limitation. Tried to change the directory name thinking it was assuming it was originally a Mapnik source and it can’t read the map. Is this directory sturcutre name hardcoded into the API?

  • grave digger

    hi haak, i tried your simple tutorial but i only see the view without map. also i have an error called “Error opening trace file. No such file or directory(2)” on log cat. is this error cause my-not-showing-map problem?

  • Android Dev

    Hi, anybody can help me.. I tried this tutorial. In my case, Tile is loaded but the map view is not loading. Can any one suggest your points..

  • Thankyou for this great tutorial, John! Great stuff! 🙂

    • Kamran

      I did same but my xml shows following error

      The following classes could not be found: – org.osmdroid.views.mapview

      • Hey Kamran, I´ve just verified the code, everything runs fine here. Please double check your code.
        In your layout XML file, you must have it like this:

        In “” file, you must have: import org.osmdroid.views.*;

        • Coinhunter

          Could just be that his files were in the /lib directory instead of /libs. That gave me a bit of trouble.

    • Muhammad Shehzad Arshad Virk

      where to fine these two files “slf4j-api-1.7.5.jar” and “slf4j-ext-1.7.5.jar”

    • Thanks so much, I haven’t been following these comments for a few months now. Fun to see that it is still being used. Thanks for helping me answer questions. When I have time (hopefully in not to long), I will try to follow the tutorial and update it where needed.

      • Thankyou for this awesome step-by-step tutorial, © John Wika ! 🙂

  • Kamran Ahmed

    I tried this tutorial but app force closes and gives this error in log cat : No Class Def Found Error : org.osmdroid.views.MapView

    • Basheer p m

      please check the java-build path of your project, and go to order and export tab, check whether the libraries in checked state or not…
      In Eclipse you have to check the libraries which are needed under the order-export tab.

      I know I am writing after a long the question been asked! but may help someone else…

  • Nizam

    Its GREAT!!! Thanks a Ton.

  • TiagoPereira

    Hi… I do the the same thing as you mentioned in this tutorial but i cant move the map and make zoomIn or zoomOut… anybody can help me? Thanks.

  • vamsi krishna

    I do the the same thing as you mentioned in this tutorial but my
    appliaction isnot loading tiles from sd card so it results in blank map
    view with out zoomable control. Can u tell me any solution for this prob?

    Dear sir

    I copied everything /mnt/sdcard/osmdroid/ as

    and my Activity is

    MapView mapView = new MapView(this, 256); //constructor



    setContentView(mapView); //displaying the MapView

    mapView.getController().setZoom(14); //set initial zoom-level, depends on your need

    //mapView.getController().setCenter(new GeoPoint(17.382095,78.485527)); //This point is in Enschede, Netherlands. You should select a point in your map or get it from user’s location.

    mapView.setUseDataConnection(false); //keeps the mapView from loading online tiles using network connection.

    But finally my output is following screenshot

    Sir please help me? advance Thank u sir.

  • manish

    can you tell me how to add popup window with detail and image of that point and how to change the icon of hand on search of position.

  • Coinhunter

    Any chance of a clarification of the directory to place the .zip file in?

    I’ve put my zipfile “” in the following directories in case one was the right one but no joy… I’m using a Samsung S4

    /DeviceName/Card/osmdroid/ <– i'm betting this is the intended directory.

    I get the error:

    Error downloading MapTile: /13/4096/4095
    java.lang.SecurityException: ConnectivityService: Neither user xxxx nor current process has android.permission.ACCESS_NETWORK_STATE.

    Unclear what is going wrong. Created map using the Stockholm region as you can tell by the filename, also changed the coordinates to:

    mapView.getController().setCenter(new GeoPoint(59.349033, 18.061523)); // Stockholm

    • Alvaro

      Did you find a solution. I’m having the same problem.

    • For the ones with problems in download maps, internet access, and many other similar errors, first you MUST have to add these permissions in your own “AndroidManifest.xml” before run OSMdroid:

      PERMISSIONS — Just do a Copy/Paste:


      NOTE: Can´t remember what exactly permissions I added specifically for OSMdroid, so there are them all 😉

  • Bank

    I can’t make it work. When I run application, it shows force close message. How can I make it work? Please give me some help T_T

  • janjack

    IS there a way to also have coordinates in longitude and latitude?That would be awesome to do some offline app using coordinates of known places

  • Bita

    where should I place map osdmdroid zip file to run my application in emulator?

    • Not needed to do that. It should download the maps (and create its own folders) automatically… But only IF your PC (and emulator) have internet, of course. Then all the maps (only that ones that had been downloaded) should be available even offline.

      • gumuruh

        Hi Jorge Rosa,… is this require us to have internet connection when running the app?
        I wonder how could we implement the offline map without any internet at all?

  • ari

    why is it that my app has stopped. I follow all the steps that you’ve stated.
    what is the problem?
    Can you help me ! 😀

  • ari

    so how many classes it have ?
    and what activity should I put in the AndroidManifest.xml?

  • ari

    I have a problem …
    I follow all the step but when I run my application on my device…
    the application has stopped … 🙁
    what do you guys was the problem !!
    Please help me out ..

  • Muhammad Shehzad Arshad Virk

    I do the the same thing as you mentioned in this tutorial but my appliaction isnot loading tiles from sd card so it results in blank map view with zoomable control. Can u tell me any solution for this prob?

  • Muhammad Shehzad Arshad Virk

    also when i choose mapnik its blocked like red big cros on every recangle in the mobile atlas

  • Muhammad Shehzad Arshad Virk

    i did not get any success to even view the map i would love if some one could make youtube video step by step using this tutorial thanks

    • Hi Muhammad Shehzad Arshad Virk, please try to use:
      • mapview.setUseDataConnection(true);
      • mapview.setTileSource(TileSourceFactory.MAPQUESTOSM);
      The other ways (MAPNIK and DEFAULT_TILE_SOURCE) are getting a “403 Forbidden” response from theirs servers…..

      • Muhammad Shehzad Arshad Virk

        still empty grid showing tile graphe only no map view 🙁

      • Muhammad Shehzad Arshad Virk

        Dear jorge if i am not wrong your solution is for online map view but i need to use offline do you have any idea how to use .img file formate of a map

  • DISPLAYING MAPS: A note for all OSMDroid users, before you get white hair (like me). If you get the last version (OSMDroid v.4.0) the tiles (maps) won´t display using:

    • mapview.setUseDataConnection(true);
    • mapview.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE); // Gets a “403 Forbidden” response !!!!…
    • mapview.setTileSource(TileSourceFactory.MAPNIK); // Gets a “403 Forbidden” response !!!!…

    you MUST use, by now…

    • mapview.setUseDataConnection(true);
    • mapview.setTileSource(TileSourceFactory.MAPQUESTOSM); // Gets a server “valid” response.

    …to be able to view the maps (and save it locally in your SDCard). (Note: This issue may extend to previous versions of OSMDroid too, I haven´t tried it yet). Already being reported, so we will have to wait for a fix (or an workaround). Hopefully this issue will be fixed soon…

    Issue reported at:

  • Muhammad Shehzad Arshad Virk

    can anyone tell how can i use .img formate of map file

  • sharsad

    i cant show the map at first time.if i zoom out 4 more times,that will show the map.and also the map not fit in screen.

  • sharsad

    how can i replace the sdcard path with my own..


  • Tobias

    I create an example Android Studio project which describes how to prepare MapQuest tiles for offline usage with osmdroid.

  • gumuruh

    The google maps / earth options is no longer available on Mobile Atlas Creator…
    What should I do now?

    I need the map offline to be read by osmdroid….

  • wojt

    Hi, I can see map in offline mode, but I have a problem. I see map and then when I make a zoom and move the map. I can’t see fragment of the tiles of zoomed map which are visible on the unzoomed map. This issue can be seen at the added screenshots.
    Edit links to screens

  • Tereza Stefanova

    Can I implement my own algorithm using osmdroid and osm bonuspack for finding the shortest path?

  • Muhammad Babar

    What are the supported map tiles format?

  • AyaM Sakata

    hi.. thanks for the tutorial but the app just crashes on the start up… i followed the tutorial.. I just don’t know whats wrong.. I’ve checked the logcat and the first error is a Fatal exception in main.. please help..

  • Robin

    Thank you for this detailed tutorial !
    Nevertheless I don’t manage to display the map, I can just visualize the grid. I don’t know what format to put in the osmdroid folder of my phone, I tried various times it never worked.
    Thank you for your help.

  • ashwin

    if you set the source as OpenStreetMap Mapnik the map does not load.
    I have used mapquest and loaded the Map online and downloaded in MOBAC. However, I am not able to get the map tiles displayed in android mobile. Please guide. I have tried this example and it does not wok for me.

  • Vikas Pandey

    not getting the map , after following everything as discussed , i had to use openstreet map quest as athe map source instead of mapnik ,in mapnik map was not visible in Mobile Atlas Creator .all i get is this screen shot .

    • Ronak Selarka

      I have getting the same problem..

      • Vikas Pandey

        getting empty grid is mostly because osmdroid could not find tiles in sd card .

        make sure they are present in right place.

        keep your zipped mapquest tiles in (name of zipped file does not matter)

        mnt/sdcard/osmdroid folder.


        copy this

        map.setTileSource(new XYTileSource(“MapQuest”,
        ResourceProxy.string.mapquest_osm, 0, 18, 256, “.png”, new String[]{

        • Sandeep

          I had the same problem, but then adding all the (mentioned in a comment above) and above line of code solved my issue.

        • Chuying He

          is there any chance to put the tile file in my own apk like the folder “assets” ?

        • Leonid Ustenko

          “As of July 11, 2016, direct tile access has been discontinued…”

          • Prena Mohan

            Is there any fix for this on already existing offline tiles

  • Ronak Selarka

    How to get the OSM API Key?

  • Siavash Sajjad

    It can’t recognize the setuseDataConnection for me

    build.gradle is:

    compile ‘’
    compile files(‘libs/slf4j-android-1.5.8.jar’)
    compile files(‘libs/osmdroid-android-4.0.jar’)

  • Arjun

    how to set the path of the map placed on sdcard, in the project source code…

  • Arjun

    can you explain each step with screen shots

  • Chuying He

    I’ve tried to put the osm-file into /mnt/sdcard/ using a method like Environment.getExternalStorageState(), but I always get /storage/emulated/0 back. A friend of mine tells me that, this path doesn’t work after API Level 17. So… maybe i will try to put the osm-file into assets and use the tiles directly from this folder. Any advise??