Thursday, December 8, 2011

Offline Maps in Android Applications - Part 1

The canonical way to present maps in Android applications is using com.google.android.maps.MapView class, which has Google Maps has its unique data source. This implies that you are restrained to a single map source, and that your application  must have an available data connection and internet access privileges in order to show maps. Offline maps are not possible (at least while I write these lines).

Open Street Map provides a solid alternative to Google Maps. It was conceived following the model of Wikipedia: Content is provided by the users community. A lot of effort has been made by people around the world to provide maps which follow OSM specifications, and more content is continuously being added or updated. The success of Open Street Map has promoted the creation of several open source software projects aiming to develop alternatives to the original mapping on Android, based on Google online services (initiatives as Osmand, an open source application which offers navigation and routing functionality).

In this small series of articles we will talk about implementing maps visualization using Osmdroid API, a set of classes which substitutes (with further features) Android's standard MapView and its support classes, making possible to use a variety of map sources (including Google Maps), connected or disconnected. In our next article we will show how to generate a ZIP file containing a set of raster (PNG) maps, which we will use as a disconnected data source to our application. See you soon!

No comments: