0

I have a stalled project that I would like to give a new try.

It is about to read large amount of map data from sqlite using C code. I do not understand what options I have after the scooped storage constraints in Android. I need a very performant access to the sqlite db, and I need to read it from C code.

It is working on Android 10 by just reading from a map I call TilelessMap on the phone.

So, my question is if there are any good ways to get access to an sqlite database that is not constrained and deleted with a special app. The solution must also work on unrooted phone.

I will also give a short description about the project. It is open source and more or less what I have lives here: https://gitlab.com/nicklasaven/tilelessmap

It is about rendering data from a special map data format I have called twkb (tiny well known binary). The idea is to read all data directly fom the database for each pan/zoom avoiding any caching complexity. It works very well. A have 1:50000 maps (most detailed free maps) of Sweden and Norway in my phone. It is a few GB. But that is the reason I do not want to store it in app specific area of the phone. A reinstall of the app should not mean you need to get all the map data again. I also plan to put all sync work of the database in a separate app. Then the map app is totally offline, which I think is a feature.

What makes this solution fast in rendering is 2 things.

  1. coordinates to be rendered is decoded from twkb directly into C arrays and pushed to the GPU. No objects or complex structures on the way
  2. The triangulation information for polygons is baked into the format. So there is an array with indexes ready for use that defines for the gpu how to render the triangles. So there is no client processing in run time to create the triangles.

Sorry for the long text, but I would really appreciate any hints about if shared storage used like this is possible nowadays in Android. Trying to read the docs is quite confusing for a non Android developer.

3
  • 2
    You can ignore scoped storage if you place the database in the app external files dir: /storage/emulated/0/Android/data/<app packageName>/. The the database is accessible via standard C/Linux file API calls. Commented Dec 28, 2023 at 11:41
  • thank you! But that means it will get wiped if app is uninstalled or reinstalled? And I cannot access the file from s separate synchronization app right? Commented Dec 28, 2023 at 13:02
  • 1
    Welcome to Android Enthusiasts. Please note that app development is off-topic since Android Enthusiasts focuses on end-users and power users (who are not necessarily developers) solving their issues. Thus, while this community might explain the technicality of Android OS to your queries, coding solutions are out of the scope of this community. For programming questions, you might want to try Stack Overflow. Commented Dec 28, 2023 at 15:14

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.