PDA

View Full Version : Android SDK: prebundling a country map



cherry314159
05.06.2014, 17:59
I'm trying to test prebundling withe the demo app.
I performed the following steps:


Downloaded map for Panama
Uploaded the PA.skm, PA.ngi, PA.ng.dat to development machine
Added the above files to assets/SKMaps.zip in the PreinstalledMaps/v1/20140320/package folder.
Edit SplashActivity.java and uncomment 3 lines to enable preinstalled maps.
Rebuilt the demo app
Uninstalled existing demo app and installed rebuilt demo app.
With internet disabled, ran the demo app


With these steps in place, prebundling seems to work!

dandronic
27.08.2014, 15:52
On 2.1.0

Scenario1: download a map for offline usage when online.

Start the demo project (with internet connection on) - go the Map XML & download menu, choose a country/city and download it. (e.g. Switzerland)
Close the app
Turn off internet connection
Start the app (in full offline mode) and choose map display
You will see that the map has only the "big" relief lines, except Switzerland where you can zoom in to street level and all the details are present

Scenario2: distribute the map as a prebundled app

start the demo project (with internet connection on) - go the Map XML & download menu, choose a country/city and download it. (e.g. Switzerland)
Now on the device you should be able to find the downloaded package (in my case it was at /Volumes/NO NAME/Android/data/com.skobbler.sdkdemo/files/SKMaps/Maps/v1/20140320/package ) (you can search for .skm files to make things easier)
1556
Take the 3 files and drop them in the SkMaps.zip file in the PreinstalledMaps/v1/20140320/meta/package (the 20140320 depends on which SDK version you are using) (you will need to unpack and repack the zip file)
1555
In SplashActivity.java make sure you uncomment the 3 lines responsible for prebundled maps.
// EXAMPLE OF ADDING PREINSTALLED MAPS
initMapSettings.setPreinstalledMapsPath(app.getMap ResourcesDirPath()
+ "/PreinstalledMaps");
initMapSettings.setConnectivityMode(SKMaps.CONNECT IVITY_MODE_OFFLINE);

Run again the demo, with the phone in offline mode (just to make sure that there's no internet connection)
Note: on some devices it might not work with a very big prebundled map (Switzerland has ~ 90 MB) so start with a smaller map – e.g. Andorra