ThinkGeo.com    |     Blog    |     Wiki    |     Support

Sqlitebitmaptilecache with project trageting android 7+

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

I just loaded your solution, add the licence file, changed android target to 8.1 and minimum to 4.3 in android manifest, and use 8.1 as well in tab Application. I got the exact same error System.DllNotFoundException: SqliteForAndroid

Hi Judicael,

We did the testing based on android target to 8.1 and minimum to 4.3, it works fine, please refer below video.

Could you please confirm if you clean you packages when building the sample? I think this issue maybe caused you didn’t updated the latest package.

You can double check that in the bin folder before running the sample on Android Device.

If there is still any issue, please feel free to let know that, we will help you to figure out that.

Thanks
Mark

I can see we have the same configuration, but I keep having this error after removing bin/obj/packages :frowning:

I can’t test on a virtual device as I’m already working inside virtualbox, my test are done on a samsung s8.

Hi Judicael_ribault,

What’s the API level of your s8?

You can view that in your VS after connect your device to PC.

Regards,

Ethan

API 26

I send the sample to another dev who got the exact same error on his phone as well as on an emulator API 25

testmapsuitesqlandroid7v42.zip (636.5 KB)

Hi Judicael_ribault,

Thanks for your information, our developer will look into it.

Any update I will let you know.

Regards,

Ethan

Hi Judicael_ribault,

Please update MapSuiteMobileForAndroid-BareBone package to 11.0.0-beta044 and it will solved.

The reason please refer this topic: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.0/#mono-data-sqlite

Regards,

Ethan