openbmap / radiocells-nlp-android

radiocells.org Unified Network Location Provider
https://radiocells.org
Other
41 stars 13 forks source link

Cell geolocation doesn't work #11

Closed mvglasow closed 8 years ago

mvglasow commented 9 years ago

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.

wish7code commented 9 years ago

Haven't had this on the radar yet: so far cells were only used as 'fallback' when no wifis were available. Cell-only location wasn't yet implemented. But of course cell-only location makes perfect sense.

I hacked together a local test case with cell-only location. So far it looks good, so I will probably push this upstream tomorrow, if everything turns out to run smoothly..

IzzySoft commented 9 years ago

@wish7code Please don't forget to update this issue; I'm in the same boat needing "cell only" location, so I've just subscribed to this issue to be notified when it's ready :innocent:

wish7code commented 9 years ago

Sorry for the delay, been on the road for a couple of days: just pushed the cell-only location upstream. This release will use cell-only geolocation when wifi is switched off.

For the next version we should probably also add an option in the settings menu to select cell-only, wifi-only or combined geolocation..

Let me know if you encounter any issues..

Cheers Toby

IzzySoft commented 9 years ago

Didn't mean to hurry you ;) Upstream is F-Droid I guess, so it should pop up there the next day? Oh. Just checked there and saw it requires Android 4.2+ – so the device I'd need it for is out (4.1.2). Any chance for 4.1 here?

wish7code commented 9 years ago

Usually it takes a day or two until the F-Droid updates.

Regarding 4.1.2 version compatiblity I'll have to check but I guess it should be easy to integrate.

IzzySoft commented 9 years ago

F-Droid: Yes, that's clear. Just wanted to make sure you meant that by "upstream". Thanks a lot!

4.1.2: That would be phantastic! Feel free to have me testing that before pushing it to F-Droid, if you think that's needed (to avoid "unnecessary bad feedback"). Looking forward to the 4.1.2 version – and thanks again for all your efforts!

wish7code commented 9 years ago

Done.. I don't expect any issues, but better try it out to be sure :-)

Binaries are available at https://6597aa1f72f81233f964cec56f26d45bc9ed86d3.googledrive.com/host/0B97gHr4MqjHpM2h0QVR5SWJOcGs/org.openbmap.unifiedNlpProvider-4-1-test.apk

IzzySoft commented 9 years ago

Wow! Superb! Just downloaded and adb installed. Will check and report back...

Curious: It just asks to download a WiFi database. No cell data, or are they included? Second: XposedUnifiedNlp doesn't find any UnifiedNlp location – though I've activated the backend in µg UnifiedNlp settings. Logcat doesn't show that either. Ouch, but it seems like I've finally found the culprit for that:

W/LocationManagerService(13440): org.microg.nlp implements com.android.location.service.GeocodeProvider but its signatures don't match those in com.google.android.location, ignoring

Yuck. OK, I'm going to update my issue there. Apart from that, it seems your app is working (no crashes, it is still downloading that database currently ;)

wish7code commented 9 years ago

It just asks to download a WiFi database. No cell data, or are they included?

Might be a remaining typo: actually the cell data is included. Where you find the reference to wifi? In the debug logs? Any hint and I'll correct this..

XposedUnifiedNlp doesn't find any UnifiedNlp location

The GAPPS-free setup (https://f-droid.org/repository/browse/?fdid=com.google.android.gms) seems to run smoothly. Let me check XposedUnifiedNlp setup again..

IzzySoft commented 9 years ago

When I first started the app, a popup asked me to download the WiFi database for offline use. For the string (I've just been asked again):

Download offline wifi catalog now? (approx. 400MB)

As for GApps free: Sure, there won't be a signature mismatch. I don't know what permission is protecting that part from above error message – but unfortunately it seems to be one protected by "signature" (not "signatureOrSystem"), as making UnifiedNlp a system app turned out the same way (including the same error message).

I've opened an issue with UnifiedNlp for that part.

mvglasow commented 8 years ago

With the latest build on F-Droid, cell location should work in offline mode, both when no known wifis are in range and as additional input to improve wifi-based locations.

wish7code commented 8 years ago

Guess we can close this by now, right?