ThinkGeo.com    |     Documentation    |     Premium Support

Sqlitebitmaptilecache with project trageting android 7+

Hi,

We are using SqliteBitmapTileCache and our project was targeting Android 4.3 so until now everything was working correctly.

We need to upgrade the targeting android version to the last 8.1 and got an exception about libsqlite.so
Any idea to resolve this issue ? Does anyone have a working sample project targeting android 7+ with SqliteBitmapTileCache ?

Thanks, Judicael.

Hi Judicael,

The SqliteBitmapTileCache don’t related with Android, it’s a common class, I think you should have the code about this class so you can double check that.

And it looks the reference of this class is our package https://www.nuget.org/packages/MapSuiteDependency-SQLiteCore/, the reference of it is System.Data.SQLite.Core.1.0.102.0, you can try to reference the latest version System.Data.SQLite.Core.1.0.108.0 and see whether it works well with Android 8.1.

And you can get the exception information and did some research to see whether can find some useful information about it.

Regards,

Ethan

MapSuiteDependency-SQLiteCore is not compatible with android. Does it means SqliteBitmapTileCache is not compatible with android ?

Can you provide a sample using SqliteBitmapTileCache targeting android 7 or 8 ?

Hi Judicael,

Please make sure whether your project reference our other package ThinkGeo.MapSuite.Layers.SqliteForMono, and replace any sqlite related package to the latest version of System.Data.SQLite.Core.

We don’t have the sample for Android about SqliteBitmapTileCache, please try whether it’s the dll reason first.

Regards,

Ethan

ThinkGeo.MapSuite.Layers.SqliteForMono was not installed, but i got the same exception regarding unauthorize access to libsqlite.so after I install it.
I can’t install nuggets System.Data.SQLite.Core as it’s not compatible with android

Hi Judicael,

We will try to build a sample based on Android, please wait our update about the progress.

Regards,

Ethan

Sure, thank you :smile:
In november it will be mandatory to target android 26 (8.0) to publish to the market, so i’m sure your sample will be helpfull for all of us :smiley:

Hi Judicael,

Our developer try to build a sample with android 7, but it looks we hadn’t reproduced your issue in our test device.

As below is the sample, https://ap.thinkgeo.com:5001/sharing/HWd5C8soR

Please try it and let us know whether you can reproduce it by this sample.

Regards,

Ethan

It compile and execute well, but i don’t see any improvement in loading tiles the second time, so I’m not sure the cache is really used.

I modified your sample to load osmoverlay, and on the second run I deactivate data. No tiles are loaded so I belive the cache doesn’t work when targeting android 7+

Can you provide a workaround ?

And to reproduce the error, just add a second parameter to the new SqliteBitmapTileCache constructor, for example new SqliteBitmapTileCache(“data/default.db”, “testId”);

Hi judicael,

I can’t reproduce the tile cache issue, following list is my test environment:

  1. test machine: one of our using Mobile Phone
  2. OS: Android 7.0
  3. Cache location: “/mnt/sdcard/data/default.db”.

The test steps:

  1. Open the Wifi or 4G network and get the cache file in the specified cache location.
  2. Close all networks and the app.
  3. Reopen the app and keep the network closed.
  4. The open street map imagery is still rendered on the map.

Base on the above test, the SqliteBitmapTileCache works fine.

The attached is the test app, please have a try. Post9140.zip (13.4 KB)

Thanks,

Hi Ethan,

I just open your project and it’s targeting android version 4.4 (in tab Android Manifest).
Could you try with :
Minimum Android Version 4.3
Target Android Version 7

Thanks

Hi Judicael,

When our development team develop this version and test it, the target version is 4.4. We hadn’t tested set the target version equal 7 after that.

And yesterday we had tested that you set the target version equal 4.4, sqlite can works well in V7.

Because it looks V7 set stricter limitation about Sqlite, our developer had planned to work and test for it in future version.

Regards,

Ethan

https://developer.android.com/distribute/best-practices/develop/target-sdk

Google Play will require that new apps target at least Android 8.0 (API level 26) from August 1, 2018, and that app updates target Android 8.0 from November 1, 2018.

So basically, in approx 40 days, no one will be able to publish a new app containing mapsuite cache on the android play store… I hope the futur version will come very soon.

Hi Judicael,

Thanks for your reminder, I will let our development team know it.

Regards,

Ethan

Hi Ethan,

August 1 is close now, do you have an ETA about this issue ?

Hi Judicael,

Our developer is working on it.

We will do our best to complete it before August 1.

And I think your APP should follow the limitation of November 1.

Regards,

Ethan

Hi Judicael,

It should been fixed in the latest dev package:

or

And we will release it in this week.

Please try the beta version, if you still met any problem please let us know.

Regards,

Ethan

Hi Ethan,

Just tried version beta42, and got this error:

{System.DllNotFoundException: SqliteForAndroid
at (wrapper managed-to-native) Mono.Data.Sqlite.UnsafeNativeMethods.sqlite3_open_v2(byte[],intptr&,int,intptr)
at Mono.Data.Sqlite.SQLite3.Open (System.String strFilename, Mono.Data.Sqlite.SQLiteOpenFlagsEnum flags, System.Int32 maxPoolSize, System.Boolean usePool) [0x00052] in :0
at Mono.Data.Sqlite.SqliteConnection.Open () [0x002c4] in :0
at ThinkGeo.MapSuite.Android.SqliteBitmapTileCache.set_CacheId (System.String value) [0x00026] in :0
at ThinkGeo.MapSuite.Android.SqliteBitmapTileCache…ctor (System.String databasePathFilename, System.String cacheId) [0x0001d] in :0
at ArpentGIS.Droid.MapControler.AddOSM (System.Boolean immRefresh) [0x00019] in C:\patrickribault\D3E\ArpentGIS.AndroidV11\MapControler.cs:1771
at ArpentGIS.Droid.MapControler.Init () [0x00065] in C:\patrickribault\D3E\ArpentGIS.AndroidV11\MapControler.cs:1000 }

Hi Judicael,

We did some testing with the beta040 version, it works fine. We have attached the test sample, please try again.
If there is any issue, please let us know that.

Post_9140.zip (167.1 KB)

Thanks
Mark