4
votes

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.

It also 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.

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

3
We are looking into it.Ando
If it helps at all: I am using a Mac, Eclipse (not Android studio), and am using this tool: sourceforge.net/projects/adbextractor to extract the Android backup into a .tar, which I can then browse. If you want, I can give you the full source of the app that crashes. Just let me know, I am happy to do anything that will help you guys in solving this issue.isaac.udy
Please send the the SKMaps.zip to [email protected] so that we can test it ourselvesAndo
Thanks for your detailed question, it helped me to learn how to extract offline map from the example, given that the documentation is wrong for this part because you cant get the file as they sayUltimo_m

3 Answers

6
votes

I have had a similar problem when loaded maps in sdk 2.3. I solved it by executing this thread before initializing the Maps.

final SKPrepareMapTextureThread prepThread = new SKPrepareMapTextureThread(this, mapResourcesDirPath, zip, this);

prepThread.start();

When the method:

@Override
    public void onMapTexturesPrepared(boolean arg0) {

}

"onMapTexturesPrepared" is called, you can initialize the Maps with preinstalled maps:

initMapSettings.setPreinstalledMapsPath(mapResourcesDirPath+"/PreinstalledMaps");
(....)
SKMaps.getInstance().initializeSKMaps(getApplicationContext(), initMapSettings, API_KEY);

I hope that helps, it worked for me.

4
votes

Turns out I was being slightly stupid. I was compressing the SKMaps folder, instead of the files inside of the SKMaps folder. This means my zip looked like this:

SKMaps.zip/SKMaps/PreinstalledMaps/...

It needed to look like this: SKMaps.zip/PreinstalledMaps/...

Simple solution, but it was not immediately apparent to me.

Apologies for the waste of time.

1
votes

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.getMapResourcesDirPath() + "/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/