Results 1 to 2 of 2

Thread: Android SDK: prebundling a country map

  1. #1
    Neuer skobbler
    Join Date
    05.06.2014
    Posts
    6

    Android SDK: prebundling a country map

    I'm trying to test prebundling withe the demo app.
    I performed the following steps:

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


    With these steps in place, prebundling seems to work!
    Last edited by cherry314159; 12.06.2014 at 05:23. Reason: Add step that modifies SplashActivity.java

  2. #2
    Dev platform evangelist dandronic's Avatar
    Join Date
    31.03.2014
    Posts
    177
    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)
    3F0D177D-2E09-42A3-AE03-C52ECC682CA7.jpg
    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)
    AC4686BE-9672-4D5D-B3B4-EAD9DA9C42F4.jpg
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •