biotinker / LibreTasks

An updated form of Omnidroid
Apache License 2.0
82 stars 22 forks source link

Enhancement request: action on enter/leave WiFi or mobile base station #185

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi!

I'd like to use omnidroid as an indicator for when I leave my home and arrive 
at work and vice versa. I rarely use GPS as it drains my battery additionally 
but have WiFi on most of the time.
Maybe it also is possible, if a set of mobile base stations come into/get out 
of reach.

In these events, I'd like to send an email via my corporate exchange access 
with some information like date/time (email sending may be delayed) and the 
name (or alias?) of the WiFi network / mobile base station.

Cheers,
Alex.
P.S.: Thanks for the open source. Highly appreciated! Found the app on F-Droid 
app store.

Original issue reported on code.google.com by aj.hubm...@gmail.com on 13 Jan 2014 at 7:47

GoogleCodeExporter commented 8 years ago
oh, sorry for the duplicate. I searched for WiFi, not Wi-Fi ... %-}

Original comment by aj.hubm...@gmail.com on 13 Jan 2014 at 7:50

mvglasow commented 7 years ago

For wifi see #188.

Mobile base stations are a bit trickier as phones occasionally move to a different base station even when they are stationary (the carrier may initiate this to prevent overload of a particular cell). Also, the base station may change if the phone switches between 2G/3G/4G, which may happen when entering buildings.

To make matters worse: 3G/4G don’t ever give you the full address of any other cell than the one you’re currently connected to (neighboring cells are identified by a scrambling code, which is unique only in its immediate neighborhood). With 2G you might get neighboring cells, but not all phones expose that information through their API (Samsung phones are notorious for not doing so).

My concern is that it’s difficult to get an exhaustive list of all base stations serving a particular location, (in addition to UI design being really tricky) and an incomplete list will mean the event will not fire reliably.

Looking at the cell ID format, GSM-like networks (EDGE, UMTS and LTE) have roughly the following address format:

An alternative would be to use just the country-network-location triplet, sans the cell ID. That has fewer options IDs to track, but has the following implications:

Conclusion: Cell ID is hard to get right (for the user); location code is less granular (down to a city or part of a larger city) and still not trivial to get right.