NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello Friends,

For more than 2 weeks, i was working to use OSM Offline map in Android application. I have gone through many articles, blogs and question/answers of Stackoverflow, but could not find the solutions. still i am at the stage where i was earlier.

Using, i have downloaded Map tiles of India for 2-12 Zoom level. i have given the name to the root folder is Mapnik and for its zip file. i have copied the file at /sdcard/osmdroid folder.

Below is code of my android app :

Manifest file :

alt text

Layout file

alt text Java file :

public class MainActivity extends Activity {

    private MapView         map;

    protected void onCreate(Bundle savedInstanceState) {


        map = (MapView) findViewById(;
        map.setTileSource(new XYTileSource("Mapnik",
                ResourceProxy.string.mapnik, 2, 12, 256, ".png", new String[] {}));


        IMapController mapController = map.getController();
        GeoPoint startPoint = new GeoPoint(22.8583, 72.2944);


    protected void onResume() {


asked 24 Oct '17, 08:19

Ashish7's gravatar image

accept rate: 0%

Basically I believe that you are taking the wrong approach and you should be looking at mapsforge or similar vector data based system for rendering on device instead of generating tiles.

As to your question, some debug information would be helpful, but from your code you don't seem to be telling osmdroid where your tiles are located and other required setup.

There is a demo app here that may help.

permanent link

answered 24 Oct '17, 12:00

SimonPoole's gravatar image

SimonPoole ♦
accept rate: 18%

edited 24 Oct '17, 13:33

@simonpoole, I had already followed the link and its steps, Mobile Atlas Creator is banned and it is not generating any Map tile. so i have taken the help of to generate tiles. but could not get success. i can get only blank grids on mobile screen.

please help me out. it would be good if you share latest working code snippet or let me know what i did in my above code or steps

(25 Oct '17, 07:23) Ashish7

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 24 Oct '17, 08:19

question was seen: 9,060 times

last updated: 25 Oct '17, 07:23

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum