3 Answers
3

For offline maps using OSM data i find three libraries very much useful.

osmdroid : I use this library if i have to work with tiles that are in mbtiles format that i generate using tilemill. There is a bonus library for routing called osmbonuspack that adds lots of routing and POI functionality to this library.

mapsforge: I use this library when i need to have the map data in vector format and also because it works with another great library called graphhopper in android.

graphhopper: I use this library for offline routing using osm data. This is a lightweight java routing library which work for android as well.

I suggest you take a look at these libraries if you want to use OSM with android. Also after you get somewhat familiar with these libraries i suggest you take a look at the code for popular android based tools for osm like osmand, osmtracker and Vespucci

You can find lots of tutorials on the internet based on these libraries. Do explore. I hope this helps.

Normally, OSM data is rendered to images by way of a program called osm2pgsql, which converts the raw XML extracts to a Postgres database with geometry in it. Then, a program called Mapnik is used to render the images from the database, by way of a stylesheet.

Rendering on Android is a pretty hard problem, but I've been working on a stylesheet that's designed to generate small, maximally-compressed image tiles. Maybe that would be appropriate for you?

The second point is the tougher one. I don't know if there are any good open source OSM map rendering libraries for Android. If there aren't, you will have to invest quite a lot of time to implement one yourself. Also, there are issues of how large the area you want to cover and in what level of detail. Don't expect to be able to render the whole world in zoom level 15. for example - there's just too much OSM data to be able to store it on an Android device.

An alternative would be to pre-generate map tiles on a PC and upload them to the Android device, but that requires even more storage.