Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Skobbler Maps 2.4 SDK - Offline/Prebundled Maps Crashing

Tags:

android

skmaps

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

like image 370
isaac.udy Avatar asked Dec 20 '22 06:12

isaac.udy


1 Answers

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.

like image 55
Álvaro Loza Avatar answered Mar 02 '23 22:03

Álvaro Loza