how to display osm data on android


I am trying to use open street map in my android application. For the initial testing, I just want to display a map and put an object on the map. I want to do it in offline mode( no internet connection). Is there a way to save the map of a city to my android phone and display the map in my app? I know it is all osm data. How to display map from osm data in android?


You are developing your own application?

What do you consider to be an “osm map” ?. Do you mean tiles like ? If so then you have to download all the tiles of a city on your phone first. And do you want to zoom ? Then you have to download all tiles from different zoomlevels too.

That looks a pretty technical question to me. Such a tile is just a .png image. So you are asking how to show images (next to each other) in an android app ? Then this is not the right forum.

I’m also not quite sure what you want to do. Do you intend to use pre-rendered images (tiles) or do you want to store raw data on the phone and render it “live”?

If you are looking for an example of the former, have a look at Maps (-) - it downloads tiles and displays them as a map, and can also store them for offline use. I think (but don’t know for sure) that OsmAnd can do both tile display and live rendering from raw data. Navit does live rendering using data first converted into its own file format, but I don’t know how much of the code for the Android port is actually written in Java.

These are all OpenSource, so you should be able to figure out how they work internally. There’s also a List of OSM-related Android software if that helps you.