Google Maps “Caching” for Android
Thursday, August 19th, 2010This may not be a problem for people who live in huge cities, but Australia is a big place, I’m sure most of it has no mobile phone tower coverage. So what do you do when travelling 100′s of kilometres from one town to another and you don’t know exactly where to turn?
You could try scrolling across the route using Google Maps and hope that the maps stay cached until you need them. This works some of the time. If you just want to know roughly when to turn, getting the blue directions line is usually good enough to keep you on track. I think I found sometimes even that gets lost if you use the phone for anything other than google maps or perhaps just leaving it idle for a long time.
I don’t know about you, but in such situations I want to leave little up to fate. On my old Nokia I used to have MGMaps installed. At the time Google had pressured them into stopping support for Google Maps images, but it was still possible with a little hackery pokery to get their scripts to slurp them down. Despite the occasional bum steer I’ve had asking Google Maps for direction (driving for an hour down an increasingly poor quality dirt road in New Zealand which Google had marked as a highway, only to end up nearly bogged in the middle of a forest on a track that had foot long grass growing on it comes to mind), I still find Google has the best maps. So I wasn’t prepared to settle for MapDroyd too quickly. But that is the easy option.
Skip that and go for RMaps. If you see the comments, lots of people have trouble figuring out the offline maps features. Taranfx blog post to the rescue!! Follow those simple steps to get your Google Maps goodness when you are out of range of the Google hive mind.
But wait! SQLite library for Ubuntu is not included with Mobile Atlas Creator
. In the included README.HTM it says that you can download the required Java SQLite libraries from sourceforge. But it seems to me all those links are currently broken.
To compile it, I installed a whole bunch of packages:
openjdk-6-jdksqlitelibsqlite0-devlibsqliteodbcsqlite3libsqlite3-dev
I’m not certain that all of these are required. Of course you’ll also need the regular build-essential packages required to compile stuff. Now you can follow the steps in the README.HTM, although you should download the latest version of javasqlite package (changes highlighted).
wget http://www.ch-werner.de/javasqlite/javasqlite-20100727.tar.gztar xzvf javasqlite-20100727.tar.gzcd javasqlite-20100727/./configure --with-jdk=/usr/lib/jvm/java-6-openjdkmakecp .libs/lib* /[MOBAC installation path]
If you can’t find your java home, you may need to add --with-jdk=/usr/lib/jvm/java-6-openjdk to the end of the configure command (this is the path for Ubuntu 10.04 anyway).
Now return to Taranfx blog post and then enjoy RMaps with offline Google Maps.

Update August 30, 2010:
You can migrate your tracks and markers from Google Maps too! The current version only displays 1 track at a time, but it does route lines along roads. For some reason it wont show any markers until you are at least zoom level 14. I wish this was configurable as my markers are sometimes 50kms apart, so it would be good to see them when zoomed right out. I may have to go and flag all the turn offs for my upcoming holiday, as I’m worried I could miss a few from the looks of things now.
To import them firstly export KML file from google maps either by following this post from Gmaps Tips group or using the GMapToGPX javascript. Once you have the KML file downloaded, copy it to /sdcard/rmaps/import/ on the phone. Then go into the Track and POI menus and import it (import once in POI and once in track). You might notice that it has horrible div tags around all the text, you’ll have to clean that up from the KML file manually if it bothers you too much (how’s your regular expression skills?).
All in all this has been sufficiently geeky for my liking, and the end result is exactly what I wanted! Now I have an offline GPS totally compatible with my Google Maps “My Maps” (if that makes sense).
If you have trouble figuring out what to enter into those fields, check out my old 


