PDA

View Full Version : Android: Offline/Prebundled maps are not working in 2.4



isaac.udy
10.03.2015, 03:14
I have been using the older version of Skobbler maps for a fair while now, and have found it to be quite successful. I have recently began upgrading to version 2.4, to gain some of the extra functionality provided in this version ('via points' being the main feature I am interested in).

I can get the AndroidSDKDemo project running. I can get my own project running. But as soon as I add an offline package, the app crashes every time on start up, with a "Fatal Signal 11 0x00000004".

After I have added the offline maps package to the SKMaps.zip file, it does not matter if I set the connectivity mode to online or offline, the app still crashes, just based on the presence of the files in the preinstalled maps folder.

I downloaded the offline maps package via the AndroidSDKDemo project. I then used the android "adb backup -noapk" command to create a compressed version of the app's files, and extracted the SKMaps folder. I then moved the "v1" folder from "Maps" into "PreinstalledMaps", and zipped the file, and then added this file to my test application (the one that crashes) in the assets folder.

Does anyone have any ideas on how I can fix this problem? It's been hugely frustrating for me, as I can't really figure out why things aren't working. I may be doing something wrong, but I am lost as to what this might be.

Thanks in advance for your help

MORE INFO:
It appears that the crashing may have something to do specifically with the SKMaps.zip... If I take the SKMaps.zip file from the demo project (unchanged, just downloaded straight off the web), and place it in my test app - the app works fine. If I take the SKMaps folder that was made in the backup (and therefore contains information in the "Maps" folder, and without moving ANYTHING in this file (not even moving anything to "/PreinstalledMaps"), and put this folder in my test project, the app crashes.

Adela_Silvia
17.03.2015, 17:19
The structure from the SKMaps.zip has to be the same as in the demo, modifying or deleting any files might lead to some unexpected behavior in the worse case app crashes.

For using offline maps you first have to set the preinstalledMapsPath (In our AndroidSDKDemo DemoUtils method initializeLibrary uncomment initMapSettings.setPreinstalledMapsPath(app.getMap ResourcesDirPath() + "/PreinstalledMaps"); ) and then there are 2 ways:
1. Change the assets in the following way: Decompress SKMaps zip and add a .skm map for 2.4, in the folder PreinstalledMaps/v1/20141230/package/ Re-make the archive in assets<- this method unfortunately is not very reliable for big map packages
2. Another option would be to add packages manually. In our AndroidSDKDemo by default and if there is space the map resources are placed on the internal memory, but this can be changed in SplashActivity in the method chooseStoragePath so that the method returns just context.getExternalFilesDir(null).toString(). Use a file manager app (e.g.Astro File Manager) copy the files to [external storage]/Android/data/com.skobbler.sdkdemo/files/SKMaps/PreinstalledMaps/v1/20141230/package/

isaac.udy
19.03.2015, 01:38
Ok, I have solved the problem. The issue was that my Mac was putting all the files inside another folder in the zip file. The structure looked like this:
SKMaps.zip/SKMaps/PreinstalledMaps/... ... ...

When it needed to look like this:
SKMaps.zip/PreinstalledMaps/... ... ...

Quite a simple error, but one that took me far too long to figure out!

isaac.udy
19.03.2015, 02:53
Unsurprisingly, Skobbler struggles with the 500 or so Via Points I am trying to add. Is there a way that I can dynamically change the end point of a route? I know I can dynamically add Via Points, but it would be quite useful to be able to move the destination too.

If I can't do that, it looks like I am going to go back to my old solution, which was map out the route of each individual waypoint to the next waypoint, using polylines, and then just navigate between the current position and the next waypoint.