rtreffer / LocalGSMLocationProvider

Local opencellid based location provider backend for UnifiedNlp
Apache License 2.0
41 stars 10 forks source link

Please provide means to download updated cell database #3

Open aelmahmoudy opened 10 years ago

aelmahmoudy commented 10 years ago

Hello,

I suggest that instead of shipping the cell database with the APK (which renders the program to be huge, please bear in mind that some devices don't have much space in /data), that you would add an activity which allows the user to download the update cell database from OpenCellID, then convert the CSV to a SQLite database that is stored on the sdcard for example (or maybe the app's data dir), that is how mar-v-in implemented the old offline GSM location provider (though user had to manually download the database).

I have a question about the current design though, is the cell database extracted everytime the service is started ? or is it just the first time the user uses the service ?

rtreffer commented 10 years ago

Regarding bundeling: This is on my TODO (tagged as enhancement). I'm currently using a custom file format (~50% of the sqlite size) and I have not yet ported the generator from scala to java.

The extracted size is checked, which means it won't be reextracted if it successeds :-)

aelmahmoudy commented 10 years ago

Thanks.

By the way, the backend is now on F-Droid: https://f-droid.org/repository/browse/?fdid=org.gfd.gsmlocation

iavael commented 10 years ago

If there is still no java port, could you publish scala version?

rtreffer commented 10 years ago

https://github.com/rtreffer/compactcellstore

rtreffer commented 10 years ago

Please keep in mind that the code is very very rough :-S Just add an inline comment if you need an explanation of a code block and I'll try to help

TheArkive commented 7 years ago

EDIT: I guess what I meant to ask was...

Does a solution exist for Linux and/or windows to convert the full CSV to the proper SQLite format? (tables and all?)

If possible, I'd just as soon download the CSV to my PC once in a while, convert it, then dump it on my phone. The app seems to remotely parse the entire CSV in order to extract the relevant MCC's and that takes a while on the phone, even on a high speed WiFi connection.

Found all the relevant sites, still trying to find the main link/means of downloading the CSV (not something I intend to abuse - just prefer to have "the whole work in my hands" ;-)

I suppose as a feature request, would it be possible to manually specify the CSV in the app settings and then automatically convert to the proper SQLite format? An on-phone solution for this would be cool, unless the relevant tools are already accessible on Windows / Linux.

EDIT2: When I look on my phone under org.fitchfamily.android.gsmlocation/files ... i see:

lacells_gen.log (0.92 MB)
lacells.db.new (552 MB)

When I connect my phone to my PC (windows) and look at the same folder I see:

lacells_gen.log (135 KB)
new_lacells911689997.db (36.1 MB)
new_lacells911689997.db-journal (36 KB)

This is after having done a download of most of the EU countries through the app. If I were to try and convert the CSV myself (assuming I can figure it out), would I just point the settings to an SQLite db file? or is something else going on behind the scenes that creates the new-lacells***.db file(s) files only visible over MTP on the PC?

Thanks for this great resource!!!