Giter VIP home page Giter VIP logo

radiocells-nlp-android's Introduction

About

Main repository for the openbmap client 'Radiobeacon' Radiobeacon tracks cells and wifis and uploads them to the openbmap database available at https://radiocells.org

Build requirements

  • Android Studio 1.5

To get started open Android Studio, File Menu --> New --> Project from Version Control --> Github --> add repository https://github.com/wish7code/openbmap.git

Related projects

openbmap Unified Network Location Provider Uses the openbmap dataset for cell and wifi based geo-location https://github.com/wish7code/org.openbmap.unifiedNlpProvider/issues

Binaries

Binaries are available at https://f-droid.org/repository/browse/?fdid=org.openbmap

radiocells-nlp-android's People

Contributors

daktak avatar naofum avatar poussinou avatar thuryn avatar wish7code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

radiocells-nlp-android's Issues

README.md is missing

I have a lot of questions which aren't answered in the missing README.md :-)

  • How does this relate to https://github.com/microg/android_packages_apps_UnifiedNlp? Is one a fork of the other? Are they competive? Do they use the same interface to plugins?
  • Security properties aren't explained. It seems this does no lookups and thus no network activity, but it would be nice to say that.
  • there's no explanation about fitting on rooted/unrooted devices with or without gapps.
  • In these providers, it seems there is a way to return "last known location". But arguably that's a security bug, if one only starts up programs that might send location in some places. (Yes, I know starting or more accurately stopping is a concept that the Android architecture doesn't like.) So it seems a unifiedNlpProvider should have a way to decline to provide that.

Crashing on my phone

Logcat:

02-28 15:41:09.980 D/NlpLocationBackendHelper(3892): Binding to: Intent { act=org.microg.nlp.LOCATION_BACKEND pkg=org.openbmap.unifiedNlp cmp=org.openbmap.unifiedNlp/.services.OpenbmapNlpService }
02-28 15:41:10.010 I/ActivityManager(3434): Start proc org.openbmap.unifiedNlp for service org.openbmap.unifiedNlp/.services.OpenbmapNlpService: pid=20158 uid=10342 gids={50342, 9997, 3003, 1028, 1015} abi=armeabi-v7a
02-28 15:41:10.180 D/ACRA (20158): ACRA is enabled for org.openbmap.unifiedNlp, intializing...
02-28 15:41:10.190 D/ACRA (20158): Looking for error files in /data/data/org.openbmap.unifiedNlp/files
02-28 15:41:10.200 D/NlpLocationBackendHelper(3892): Bound to: ComponentInfo{org.openbmap.unifiedNlp/org.openbmap.unifiedNlp.services.OpenbmapNlpService}
02-28 15:41:10.200 I/org.openbmap.unifiedNlp.services.OpenbmapNlpService(20158): Opening org.openbmap.unifiedNlp.services.OpenbmapNlpService
02-28 15:41:10.210 D/org.openbmap.unifiedNlp.services.OpenbmapNlpService(20158): Pref online
02-28 15:41:10.210 I/org.openbmap.unifiedNlp.services.OpenbmapNlpService(20158): Using online geocoder
02-28 15:41:14.360 I/org.openbmap.unifiedNlp.services.OpenbmapNlpService(20158): Using 2 wifis for geolocation
02-28 15:41:14.380 D/org.openbmap.unifiedNlp.services.OpenbmapNlpService(20158): No cell available (getAllCellInfo returned null)
02-28 15:41:14.380 E/ACRA (20158): ACRA is disabled for org.openbmap.unifiedNlp - forwarding uncaught Exception on to default ExceptionHandler
02-28 15:41:14.380 E/AndroidRuntime(20158): Process: org.openbmap.unifiedNlp, PID: 20158
02-28 15:41:14.380 E/AndroidRuntime(20158): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.wifi.SCAN_RESULTS flg=0x4000010 } in org.openbmap.unifiedNlp.services.OpenbmapNlpService$1@5c5bd0f
02-28 15:41:14.380 E/AndroidRuntime(20158): at org.openbmap.unifiedNlp.services.OpenbmapNlpService$2.onWifiResultsAvailable(OpenbmapNlpService.java:207)
02-28 15:41:14.380 E/AndroidRuntime(20158): at org.openbmap.unifiedNlp.services.OpenbmapNlpService$1.onReceive(OpenbmapNlpService.java:101)
02-28 15:41:16.910 D/NlpLocationBackendHelper(3892): Unbound from: ComponentInfo{org.openbmap.unifiedNlp/org.openbmap.unifiedNlp.services.OpenbmapNlpService}
02-28 15:41:16.930 I/ActivityManager(3434): Process org.openbmap.unifiedNlp (pid 20158) has died
02-28 15:41:16.930 W/ActivityManager(3434): Scheduling restart of crashed service org.openbmap.unifiedNlp/.services.OpenbmapNlpService in 1000ms
02-28 15:41:18.020 I/ActivityManager(3434): Start proc org.openbmap.unifiedNlp for service org.openbmap.unifiedNlp/.services.OpenbmapNlpService: pid=20288 uid=10342 gids={50342, 9997, 3003, 1028, 1015} abi=armeabi-v7a
02-28 15:41:18.130 D/ACRA (20288): ACRA is enabled for org.openbmap.unifiedNlp, intializing...
02-28 15:41:18.140 D/ACRA (20288): Looking for error files in /data/data/org.openbmap.unifiedNlp/files
02-28 15:41:18.150 D/NlpLocationBackendHelper(3892): Bound to: ComponentInfo{org.openbmap.unifiedNlp/org.openbmap.unifiedNlp.services.OpenbmapNlpService}
02-28 15:41:18.150 I/org.openbmap.unifiedNlp.services.OpenbmapNlpService(20288): Opening org.openbmap.unifiedNlp.services.OpenbmapNlpService
02-28 15:41:18.150 D/org.openbmap.unifiedNlp.services.OpenbmapNlpService(20288): Pref online

Add compatibility with Android 4.0.4

Could you add compatibility with Android 4.0.4?
Everything works fine with Xinstaller plugin for Xposed. Coordinates come from both cells and wifi. But only until the first reboot. When rebooting, the openbmap service hangs. I have to do manual restart openbmap and then everything works fine again. Logcat on reboot:

`10-30 23:39:19.509 I/ActivityManager( 383): Start proc org.openbmap.unifiedNlp for service org.openbmap.unifiedNlp/.services.RadiocellsLocationService: pid=880 uid=10115 gids={3003, 1015}

10-30 23:39:32.349 I/ActivityManager( 383): No longer want org.openbmap.unifiedNlp (pid 880): hidden #13 `

Getting an old location

Firstly thanks for your work.

I use de f-droid build on my FairPhone1. When I loose the GPS signal then I recieve an old location.

Compatibility with API Level 17

I cannot install f-droid.org build on my FairPhone Kola Nut 1.8 (FP1U with AOSP 4.2.2). Other backends works with LegacyNetworkLocation.apk

Missing version check for API getNeighboringCellInfo

Hi, there, I've found a version check is missing in version 0.2.9, the app is downloaded from F-Droid.

It is related to the following call chain:

org.openbmap.unifiedNlp.services.RadiocellsLocationService$2.run()void
 org.openbmap.unifiedNlp.services.RadiocellsLocationService.access$300(org.openbmap.unifiedNlp.services.RadiocellsLocationService,java.util.List)void
  org.openbmap.unifiedNlp.services.RadiocellsLocationService.getLocationFromWifisAndCells(java.util.List)void
   org.openbmap.unifiedNlp.services.RadiocellsLocationService.getCells()java.util.List
    android.telephony.TelephonyManager.getNeighboringCellInfo()java.util.List

The API getNeighboringCellInfo is added in Android API-level 25, if it is called in under 25 device, the app will crash. It may be better if we can check for the runtime version before calling it, such as:

if (Build.VERSION.SDK_INT >= 25)
    List list = getNeighboringCellInfo()
else
   // something else

@wish7code Can you help me review this? Very thanks!

does not request the location runtime permission

hi,

the app does not request the location runtime permission. the result is that on recent androids it crashes when the permission is denied with this exception:

05-20 18:29:06.892  9621  9621 D org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService: Scanning wifis & cells
05-20 18:29:06.896  9621  9621 E org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService: Error retrieving network operator, skipping cell
05-20 18:29:06.899  9621  9621 D AndroidRuntime: Shutting down VM
05-20 18:29:06.900  9621  9621 E AndroidRuntime: FATAL EXCEPTION: main
05-20 18:29:06.900  9621  9621 E AndroidRuntime: Process: org.openbmap.unifiedNlp, PID: 9621
05-20 18:29:06.900  9621  9621 E AndroidRuntime: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.wifi.SCAN_RESULTS flg=0x4000010 (has extras) } in org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService$1@34c2d8e
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52511(LoadedApk.java:1323)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:790)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6494)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: Caused by: java.lang.SecurityException: getCellLocation: Neither user 10090 nor current process has android.permission.ACCESS_COARSE_LOCATION.
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2004)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1950)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at com.android.internal.telephony.ITelephony$Stub$Proxy.getCellLocation(ITelephony.java:2895)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.telephony.TelephonyManager.getCellLocation(TelephonyManager.java:1167)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService.getCells(RadiocellsOrgNlpService.java:334)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService.getLocationFromWifisAndCells(RadiocellsOrgNlpService.java:283)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService.access$300(RadiocellsOrgNlpService.java:61)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService$3.onWifiResultsAvailable(RadiocellsOrgNlpService.java:255)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at org.openbmap.unifiedNlp.services.RadiocellsOrgNlpService$1.onReceive(RadiocellsOrgNlpService.java:124)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52511(LoadedApk.java:1313)
05-20 18:29:06.900  9621  9621 E AndroidRuntime: 	... 9 more
05-20 18:29:06.900  9621  9621 E ACRA    : ACRA is disabled for org.openbmap.unifiedNlp - forwarding uncaught Exception on to default ExceptionHandler
05-20 18:29:06.906  1345  1419 I ActivityManager: Showing crash dialog for package org.openbmap.unifiedNlp u0

how to repro

on a recent android, go to settings, find the app's permission, deny location permission. the app should fail.

how to fix

make the app request location permission if absent. if denied, pop up a message box sating something like:

The blah-blah app requires location permission to work. Please open device settings and grant the location permission to this app. (It is usually found in Settings/Apps/App permissions/Location). [Kill app] [Retry access]

requesting a runtime permission is very simple, please check out this commit:
Lanchon/sigspoof-checker@3db6c9a

and official docs are here:
https://developer.android.com/training/permissions/requesting

thank you!

Tiny survey about energy aware software practices.

Dear contributors,

would you be willing to fill in a short 5-10 min survey (https://forms.gle/F3YwtLVKtk47yVhC9) about energy-efficient mobile development practices in the context of my master thesis? It's about raising awareness of software energy practices and about introducing a new open-source tool for helping in that regard. Your input would be greatly appreciated. Thanks a lot!

Ricardo Morais.

cell-based geolocation issue on some Android ≤ 4.1 devices

Thanks again for making it available for 4.1 – but now I found a minor "incident" with that. There's a method referenced not available before Android 4.2 concerning cell-based geolocation (for details, see this issue for the Mozilla backend).

You can find a stack-trace here at pastebin.com for what's happening. Seems not to be that crucial, though, as a location is still found:

I/org.openbmap.unifiedNlp.Geocoder.OnlineProvider(11635): JSON response: {"source":"wifis","accuracy":30,"location":{"lng":11.570856997514667,"lat":48.166475879909996},"measurements":104}

A solution would be an additional option in the module's settings to discable cell-based location. E.g.

[ ] use cell-based location (4.2+)
[x] use WiFi based location

and initially disable the first option on lower Android versions, but still give the user the chance to check it on "own risk", as some 4.1 devices indeed seem to support it – if I understood Marvin correctly:

Using gsm cells to geolocate is not possible on Android version 4.1 and below because of missing API support on most devices.

(emphasis mine).


I'm still jumping between the different projects here at Github with my issues "mixing things up": Though OBM finds a location, UnifiedNlp doesn't seem to pick it up – but reports the Google location instead (details in the linked issue; and yes, I do have the Xposed UnifiedNlp module installed and loaded – as in all my tests, it reports having found a location, but it's not a UnifiedNlp one) … Or could it be your module doesn't "hand it through" here? The above line is the only proof I have OBM found a location – and after all it only reports "JSON response", not "location found".

Ah, yuck: See a longer excerpt at this pastebin: Looks like after finding the location, it simply crashes :(

java.lang.NoSuchMethodError: android.location.Location.getElapsedRealtimeNanos

DeviceInfo: This time a tablet running stock 4.1.2, so no cell module/SIM (if you need closer info on the device, just let me know).

Use same wifi catalog for location UnifiedNLP backend and Radiobeacon

Looking at both wifi catalog databases, I see the schema differs slightly, though both hold essentially the same information. Being able to use one DB for both would have the following benefits:

  • Occupies less space on the phone (would currently use 400 instead of 800 MB)
  • Updating is easier for the same reasons (I need to pull just one update, not two)
  • Using Radiobeacon's "Sync scanned wifis locally" feature, I could make the location provider use wifis that I have just scanned, with no need to download anything.

Upload stats show no cells

After a hiatus, I have started uploading wifi and cell data again, but the upload stats page shows not cells. Is it an issue from my side?

de.sqlite currupt?

With the newly downloaded de.sqlite, I cannot find my current position, although I contributed it a few years ago to the database via radiocells. Surprisingly, the current file is quite small (297 MB). On my tablet, I still use the de.sqlite from February, which has a size well above 1GB. Using that file, I can locate my position without problem. Could it be that in the current de.sqlite a lot of position data are missing? I Would be greatful if you could check the file and upload again a complete new file. Thanks.

Filter wifis used for location lookup aganist blacklist

As a mitigation to constantly moving wifis, or bogus BSSIDs, I suggest porting the local SSID/BSSID blacklist logic from Radiobeacon to the location provider.

As the blacklists have evolved over time, some wifis that should now be blacklisted are in the catalog. (I must have added a good deal of GoPro cameras before they got blacklisted.)

Right now, I frequently catch some bogus BSSID in various parts of town that seems to be somewhere in Bulgaria – in any case, the location reported is at a random location along a fairly straight line between my actual location and Bulgaria – sometimes in Slovenia, sometimes in Croatia... I initially suspected 00:00:00:00:00:00, which both my smartphones seem to pick up occasionally and which will not disappear from the wifi scan results until I disable and re-enable wifi, but the online API reports no location.

Blacklists may not be a perfect solution, but I expect they'll improve things in this case until we have better measures in place.

CM 13 no Location Data

After installing this provider on CM13 I don't get any location anymore. (Using Online Data)

Mozilla NLP is running fine.

Here GPS Location says: Network not enabled.

Keep downloaded database updated

It seems that when an offline catalogue is downloaded that it never is checked for updates again.

Would it be possible to introduce such a feature?

Moved wifis confuse location provider

My office moved to a new location last year, along with its 7 wifi access points. The new location is approximately 2 km (as the crow flies) from the old one.

When I try to get a location from the location provider in the office, the location returned is about half way between the old and the new one. Further investigation revealed that I pick up 12 wifis in the new location, of which 9 are in the wifi catalog. One is still at the old location (according to the wifi catalog), two are in the vicinity of the new location, while the remaining ones are about halfway between the two locations.

This is probably an issue with server-side processing rather than with the location provider. We'll probably need some logic on the server side that checks for signs of BSSIDs moving position. This could be done by checking the maximum distance between two measurements – when it exceeds a certain threshold, it is a sign that the base station may have moved. The threshold itself could be dependent on signal strength, with a lower threshold being applied to stronger signals.

Wifis that exceed that threshold need to be treated specially. Options include:

  • Reduce the accuracy of the wifi position proportionally to the ratio between threshold and actual distance
  • Analyze the history of measurements: if pairs of subsequent measurements are generally below the threshold but very few pairs exceed it, this is an indicator of a single position change – use only measurements taken after the threshold was last exceeded and discard all earlier ones. If thresholds are frequently exceeded, this may be a sign of a constantly moving wifi which should not be relied upon for location.

Invalid position when none of the wifis in range is known

Recently I fired up SatStat, and to my surprise the OpenBmap location provider claimed that I was in the middle of the ocean, at 0°N/0°E. Closer investigation revealed that for some reason I was using an old wifi catalog (ca. August 2013) which, as far as I remember, had no wifis in the area I was in. Apparently the location provider reports zero latitude and longitude when wifis are in range but none of them are in the catalog – the correct thing to do would probably be not to report a location at all.

Geolocation doesn't work with Android 9 (Pie)

I cannot get a geolocation fix on Android 9 in Germany, neither using offline nor online mode.

Is the app not compatible with Android 9 or is something wrong with de.sqlite database?

Thanks!

crash

Enabled openbmap with offline database de.sqlite as of 2019-04-06 (size 1.048.301.568 Bytes). It promptly crashed.

System: LineageOS 15.1 (current updates) on whyred, with xposed&xprivacylua but no restrictions on openbmap.

java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed (code 11): , while compiling: SELECT count(name) FROM sqlite_master WHERE type='table' AND name='wifi_zone'
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:890)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:501)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:37)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:46)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1392)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1331)
at org.openbmap.unifiedNlp.geocoders.OfflineProvider$1.hasWifiTables(OfflineProvider.java:495)
at org.openbmap.unifiedNlp.geocoders.OfflineProvider$1.doInBackground(OfflineProvider.java:208)
at org.openbmap.unifiedNlp.geocoders.OfflineProvider$1.doInBackground(OfflineProvider.java:106)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 4 more

Thank you!

Thank you!

Thank you for your project and software!

Thank you for maintenance in the past and in the future!

Kind regards and season's greetings!

No Cell/Wifi Location under 4.1.2 & 7.1

Hello,

seems that the openbmap location service don't work under 4.1.2 here on an old S2. Makes no difference if i use offline or online mode. So i tested unified with the mozilla and apple backend with success. Is there an known problem with the openbmap & 4.1.2 ? Perhabs openbmap works but there are no known networks avaiable?

Update: Also with the latest version 0.2.8 + nougat 7.1 (lineageOS) + microG i didn`t get any location. Neither in offline mode nor in online mode with running network.
Other nlp services still works fine.

Has project been abandoned?

Hi there!

I was wondering whether this project has been abandoned. I noticed that the geolocation service does not work anymore on Android 9 & 10, and the apps have not been updated for a long period of time.

It really would be a shame. For data protection reasons, I find it absolutely necessary to have a WiFi/Cell tower location service based on an offline database. Unfortunately, there is no alternative for a wifi location service using an offline database, if this project is abandoned.

Please keep the work up!

Thanks!

Encrypted location requests

Now that radiocells.org is encrypted and secure location requests work in Firefox I would love to see encrypted requests in the backend. Could you add a checkbox in the settings to enable/disable secure requests? You might could enable it by default.

Always asking to download database for offline

The first time I open it -> Download? Yes/No
I choose Yes, it starts, it's very slow takes it 4-5 hours.

It has finished, it's says it has version 2015-11-xx, BUT a dialog says I don't have the database -> 8Download? Yes/No*

  • No - no database -> hence ONLINE mode activated
  • Yes - download AGAIN for 4-5 hours

Activating OFFLINE -> a dialog says I don't have the database -> Download? Yes/No -> GO TO START

In settings:

  • data.ref_database_version is 2015-11-xx
  • data.ref_database is none

What value should data.ref_database have so that it detects the ALREADY DOWNLOADED database?

Cell geolocation doesn't work

Steps to reproduce:

  1. Select offline mode.
  2. Download the latest database.
  3. Disable wifi so that geolookup is forced to rely on cells.
  4. Start SatStat and go to map view.

Here I would expect a very approximate location based on the current cell. Instead I am not getting a location from the NLP at all. As soon as I re-enable wifi I get a location again.

I have examined the database, and the serving cell (as reported by SatStat) is definitely in it.

Tested with version 0.1.4 on Cyanogenmod 11.0 M11 on two different devices. The serving cell was a 3G cell in one case, in the other the device was on 2G first, then switched to another 2G cell and finally to 3G.

I repeated the test with online mode selected (wifi disabled again), same issue – geolocation doesn't work (data connectivity is there, thus network issues are unlikely). I've been unable to get any position information without wifi enabled.

Still invalid position when none of the wifis in range is known in openbmapnlp backend 0.1.11

There still seems to be a bug in version 0.1.11 of the openbmapnlp backend. When none of the wifis in range is known in offline mode, it displays the position 0.00E / 0.00N in the middle of the ocean south west of Nigeria. Instead it should rather not find a position at all.

This issue refers to issue #6 in the org.openbmap.unifiedNlpProvider repo on github. The issue could not be reproduced with version 0.1.4, hence the issue was closed, but it seems to be present again in version 0.1.11.

Thx @jw243 for reporting

CM13: cannot download offline databases

version 0.2.3 (version code 15)

if i try to download an offline database, the download service is started but no file is downloaded. the service shows a notification saying <Untitled>, no progress is made, the service retries for several minutes then gives up. no further info is given in the download manager UI: there, the download name is blank.

this happens even after i disable AdAway and reboot.

however, i can successfully download https://cdn.radiocells.org/ar.sqlite manually from the same device though. if i put the downloaded file in the right sdcard folder and restart the location provider, it is shown and i can select it under "Offline database" in the settings UI.

openbmap is very crashy

Every time my phone starts, I get a dialogue telling me it has crashed. Also again at other points when I am using the phone.

I used alogcat to check logs and get errors about no database.

So, I go to settings to download nz database. The icon for downloading files appears in the top-left corner, but nothing happens. I can download the file from my web browser OK, but not from within openbmap settings. I have tried killing and restarting the download, but the same thing happens, no progress.

The download folder exists on my phone and there is enough space to store it.

This is on Replicant 4.2, downloaded via f-droid.

Cheers

Check for datestamp of database on server

The feature to download the database from within openbmap is very useful. Before downloading it, it would be useful to know if the version on the server is newer or not. Or even better, an "Upgrade database if newer" option. Cheers

Doesn't give cell nor wifi location on Android Nougat.

First thought that only cell based location doesn't work, because I first got wifi based location, but then it stopped also working.

Tried this on GAPPless Oneplus One running android nougat 7.1.1 candy7 rom.

  1. Downloaded wifi catalog
  2. Activated offline mode
  3. first got wifi location while testing using Osmand, but after turning off wifi in order to test whether it gets cell location aswell, it just stopped giving any kind of location - despite reactiving later wifi.
  4. Tried both online and offline mode - no difference.
  5. Tried all the location options: wifi&cell, wifi only, cell only, none of them worked.

I'm also radiocell contributor, and thus this very spot is 100% covered. All wifi's and cells are collected from this spot - so missing data is not the issue.

I also get an instant location if I use opencellid data (localgsmbackend).

add support for rotating among preferred network type

Generally, a phone is in LTE mode, and prefers LTE to 3G, and 3G to 2G. This is of course fine for actual use, but it results in not scanning 2G and 3G cellids in places with LTE coverage. One can manually set the phone to 3G and record those, or 2G, but that's not safe if driving.

This ticket asks for support in radiocells-nlp-android to change the data mode periodically. One approach is to change every few seconds, long enough to get a lock on the new mode and wait for it to settle. That might be bad for power use (even with external power, heat matters), and I don't know if each connection to data results in a charge (so perhaps an option to turn off mobile data when doing this?). But it might also result in signal strength measurements for cells in places where they are not the cell you end up on, which would be a bonus in the science project aspect. An alternative would be to change every 1 minute to 5 minutes. This would not necessarily scan all 3 modes on a given trip, but it would result in coverage over time without effort.

I don't know if apps can change this setting, or if the Settings app is special, etc.

Move data folder from userspace to Android/data

Currently data is saved under /storage/emulated/0/Android after uninstalling application the data is not removed. If data would be stored under /storage/emulated/0/Android/data/org.openbmap.unifiedNlp it would be removed with application and would be hidden from user.

Use the following code to get proper directory data:

Log.i(TAG, getExternalFilesDir(null).getAbsolutePath());
/storage/emulated/0/Android/data/app.id/files

All apps (root or not) have a default data directory, which is /data/data/. By default, the apps databases, settings, and all other data go here. If an app expects huge amounts of data to be stored, or for other reasons wants to "be nice to internal storage", there's a corresponding directory on the SDCard (Android/data/)

lost Settings after phone reboot

I have installed µg UnifiedNlp (no GAPPS) on my Motorola Moto E 2. Generation with Cyanogenmod 13 nightly ( cm-13.0-20160330-NIGHTLY-surnia.zip) and also installed
OpenBmapNlpBackend

In UnifiedNLP Settings i Configure location backends:
-Online/offline mode --> "Offline mode"
-Offline database --> "openbmap"
-Database folder --> /storage/emulated/0/Android/data/org.openbmap.unifiedNlp/files

After reboot the phone i get this screenshot error and the settings are gone and it is
-Online/offline mode --> "Online mode"
-Offline database --> "None"

I am not sure if it is a bug in UnifiedNlp or in CM 13 nightly. Maybe you can help? Sorry for my bad english.

The developer guess this is a bug in OpenBmapNlpBackend. See microg/UnifiedNlp#83 (comment)
screenshot_20160404-234702

Crash with JSONException

05-04 10:17:46.162 E/JSON Parser( 5064): Error parsing data org.json.JSONException: Value Invalid of type java.lang.String cannot be converted to JSONObject
05-04 10:17:46.162 E/org.openbmap.unifiedNlp.geocoders.OnlineProvider( 5064): JSON data was null
05-04 10:17:46.179 V/WifiHAL (  508): event received NL80211_CMD_TRIGGER_SCAN
05-04 10:17:46.196 I/ActivityManager( 2667): Force stopping com.google.android.gms appid=10043 user=0: from pid 7883
05-04 10:17:46.196 I/ActivityManager( 2667): Killing 4688:com.teslacoilsw.launcher/u0a136 (adj 100): stop com.google.android.gms

Please provide the apk for the latest commit.

Trying to compile the latest source I get a bunch of errors.
Trying to fix them, Studio compiles an apk that installes under LineageOS 16 but then remains invisible.
So no chance to start it nor load a country db and bring it to work.

Please, provide an apk for the latest commit.

Thanks,
wistein

File access restrictions in Android 10/11

Android 10 introduced new restrictions on file access by apps (with an opt-out for existing apps, which was discontinued in 11). These are designed to prevent apps from accessing each other’s files, and reduce filesystem access to shared storage.

This becomes an issue when sharing a cell/wifi database between Radiobeacon and the location provider backend (as I do, so whenever I scan new wifis, I can immediately use them for georeferencing).

Rules for file access are as follows:

  • Apps can still access their private and external private (/sdcard/Android/data/com.example.package/files) storage using filesystem paths. Caveat: /sdcard may have several aliases in the file system, but not all of them are created equal – some work, others don’t (which I had to learn from painful experience, as Google didn’t bother documenting that). To be safe, never hard-code this path but obtain it from the API.
  • android.permission.WRITE_EXTERNAL_STORAGE no longer grants access to the whole filesystem, only to media files (music and pictures).
  • Other file access must use the storage framework. IIRC this also means apps cannot access any of these files without user interaction.
  • File manager apps can request a new permission, android.permission.MANAGE_EXTERNAL_STORAGE, which will restore full access to /sdcard (not sure about other apps in /sdcard/Android/data: they might still not be accessible), as was the case prior to Android 10. However, this feature is intended for apps with a valid use case (file managers etc.) – not an issue for apps which are not intended to hit the play store, but Google will reject apps from the play store if they request this permission without a use case that is satisfactory to Google.

On the other hand, sharing an SQLite database file between two processes has never been a good idea (afaik simultaneous access isn’t even supported), so this would be the time to sort this out. The Android way would be to use a content provider. If the backend is a SQLite database, this is fairly straightforward. The architecture then would be:

  • The location provider backend would manage the file (in its own storage area) and expose a content provider. For simple lookup operations, everything works as before; the only addition is that there is a content provider for other apps to interact with the database.
  • Radiobeacon would get an option to use the content provider instead of a file for the database. Operations would be the same as before (it could display wifis on the map, check if a newly scanned wifi is already in the DB, or sync the DB with newly scanned wifis). Internally, we’d have to see how much code can be reused – the content provider API is similar to the SQLite one. If Radiobeacon uses raw SQL somewhere, that might need reworking.
  • In order to protect the DB from being accessed by any application, the location provider backend could implement a custom permission for access to the DB and enforce this; Radiobeacon would then request that permission. (We’d have to see if that is possible if Radiobeacon is installed on a device which does not have the UnifiedNLP backend.)

Those who use Radiobeacon and the location provider backend would then have the location provider backend manage the DB, and Radiobeacon would rely on the location provider backend for any DB operations. Those who use just one or the other could continue to do so, with no changes.

No lcoation (online/offline) with Oreo

Neither with offline (Germany) database nor online. Calling it in "energy save mode" via SatStat gives an Error : "JSON data was null".
Anything what I am doing wrong.
The backend "GSM location" works (but that one doesn't support Wifi location).

Downloadable data sets outdated

The most recent raw and processed data sets on the website are nearly two years old. Would updates be warranted at this point? If this is time consuming maybe just updating the raw data would be sufficient so folks can generate the data sets themselves if they desire.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.