Example of how to use the MBTilesDroidSpitter librairy
Java
Latest commit d6ebbbd Apr 2, 2011 @djcoin Reformatted readme.rst
Failed to load latest commit information.
assets/screenshots Squashed all those dirty commits ;) Apr 1, 2011
res Squashed all those dirty commits ;) Apr 1, 2011
src/org/tilespitter/mapboxtiles Squashed all those dirty commits ;) Apr 1, 2011
.classpath
.gitignore Initial commit Mar 31, 2011
.project Squashed all those dirty commits ;) Apr 1, 2011
AndroidManifest.xml Squashed all those dirty commits ;) Apr 1, 2011
CHANGELOG.rst Squashed all those dirty commits ;) Apr 1, 2011
README.rst Reformatted readme.rst Apr 2, 2011
TODO.rst Squashed all those dirty commits ;) Apr 1, 2011
default.properties Squashed all those dirty commits ;) Apr 1, 2011
proguard.cfg

README.rst

Overview

Simple example of use of the MBTilesDroidSpitter library reading the MBTiles format from Android.

Screenshots at: https://github.com/djcoin/MBTilesDroidSpitterExampleSimple/tree/master/assets/screenshots

Features

  • Load a database taken from /sdcard/map.mbtiles (change the path in source code to change the database to load, will be fixed soon)
  • Load one tile at a time given its x/y/z taken from user input and display the matching tile or error message if none
  • Display the metadata information of the table

Setting up

Fetch an sqlite "MBTiled" database if you don't have any

Get an SQLite database in the MBTiles format.

You may find some at http://mapbox.com/tileset/world-light.
E.g.: wget http://mapbox-tilesets.s3.amazonaws.com/mbtiles/World_Light.mbtiles.zip)

Make your database "Android" compatible

Android requires any sqlite database to have an non-empty "android_metadata" table.
E.g.: sqlite3 <your_database> "CREATE TABLE IF NOT EXISTS android_metadata (locale TEXT DEFAULT 'en_US'); DELETE FROM android_metadata; INSERT INTO android_metadata VALUES ('en_US');"

Load it to your device and make it fetchable

Load the database on your device.
E.g.: adb push path/to/your/sqlite_android_enabled_db /sdcard/map.mbtiles

If you load it in your sdcard base directory and name it "map.mbtiles" it will be loaded automatically. Otherwise, put it wherever you like and change the path of the sqlite database in the source code

Contributors