# Sqlitebitmaptilecache with project trageting android 7+

**URL:** <https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140>\
**Category:** Android\
**Created:** [June 6, 2018, 2:42pm UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140 "2018-06-06T14:42:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 6, 2018, 2:42pm UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/1 "2018-06-06T14:42:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [June 7, 2018, 5:43am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/2 "2018-06-07T05:43:34Z")

</div>

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/](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

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 7, 2018, 6:10am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/3 "2018-06-07T06:10:14Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [June 7, 2018, 6:54am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/4 "2018-06-07T06:54:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 7, 2018, 7:07am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/5 "2018-06-07T07:07:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [June 7, 2018, 7:45am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/6 "2018-06-07T07:45:31Z")

</div>

Hi Judicael,

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

Regards,

Ethan

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 7, 2018, 7:59am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/7 "2018-06-07T07:59:27Z")

</div>

Sure, thank you 😄  
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 😃

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [June 7, 2018, 10:56am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/8 "2018-06-07T10:56:21Z")

</div>

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](https://ap.thinkgeo.com:5001/sharing/HWd5C8soR)

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

Regards,

Ethan

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 15, 2018, 11:39am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/9 "2018-06-15T11:39:42Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 15, 2018, 12:07pm UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/10 "2018-06-15T12:07:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [June 20, 2018, 8:07am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/11 "2018-06-20T08:07:10Z")

</div>

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](https://community.thinkgeo.com/uploads/default/original/3X/d/3/d3d587ac4a26faf9d807490b5479dea1b7a6f6cd.zip) (13.4 KB)

Thanks,

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 20, 2018, 9:24am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/12 "2018-06-20T09:24:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [June 21, 2018, 6:29am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/13 "2018-06-21T06:29:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [June 21, 2018, 7:09am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/14 "2018-06-21T07:09:12Z")

</div>

[https://developer.android.com/distribute/best-practices/develop/target-sdk](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.

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [June 21, 2018, 8:23am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/15 "2018-06-21T08:23:21Z")

</div>

Hi Judicael,

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

Regards,

Ethan

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [July 13, 2018, 1:05pm UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/16 "2018-07-13T13:05:42Z")

</div>

Hi Ethan,

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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [July 16, 2018, 9:00am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/17 "2018-07-16T09:00:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [July 24, 2018, 10:47am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/18 "2018-07-24T10:47:51Z")

</div>

Hi Judicael,

It should been fixed in the latest dev package:

> **[MapSuiteMobileForAndroid-BareBone 11.0.0-beta040](https://www.nuget.org/packages/MapSuiteMobileForAndroid-BareBone/11.0.0-beta040)**
>
> This package allows you to add maps and perform GIS spatial operations within your Android application. It provides classes to work with most GIS data formats, display popups, allow spatial drawing, manage projections, perform spatial operation and...

or

> **[MapSuiteMobileForAndroid-Standard 11.0.0-beta040](https://www.nuget.org/packages/MapSuiteMobileForAndroid-Standard/11.0.0-beta040)**
>
> This package allows you to add maps and perform GIS spatial operations within your Android application. It provides classes to work with most GIS data formats, display popups, allow spatial drawing, manage projections, perform spatial operation and...

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

---

<div class="post-metadata">

**Author:** ![judicael\_ribault](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/bb73d2/32.png) [@judicael\_ribault](https://community.thinkgeo.com/u/judicael_ribault)\
**Post date:** [August 13, 2018, 2:34pm UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/19 "2018-08-13T14:34:34Z")

</div>

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 }

---

<div class="post-metadata">

**Author:** ![Mark\_Lee](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@Mark\_Lee](https://community.thinkgeo.com/u/Mark_Lee)\
**Post date:** [August 14, 2018, 4:42am UTC](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140/20 "2018-08-14T04:42:30Z")

</div>

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](https://community.thinkgeo.com/uploads/default/original/3X/6/0/6058bcb3e45097e12c859d1e936c0218104cb435.zip) (167.1 KB)

Thanks  
Mark

[Next page](https://community.thinkgeo.com/t/sqlitebitmaptilecache-with-project-trageting-android-7/9140.md?page=2)
