ge0rg / aprsdroid

APRSdroid - Geo-Location for Radio Amateurs
https://aprsdroid.org/
GNU General Public License v2.0
502 stars 96 forks source link

Feature request: notification of TCP/IP disconnect #248

Open MoTLD opened 4 years ago

MoTLD commented 4 years ago

Thanks for the awesome program! I've been using APRSdroid for a good while now, and it seems to have every feature I could desire of it (except maybe simultaneous TCP/IP and TNC connections, but I know that's a big ask).

But today I got out of range of the wifi, and when I got back it didn't reconnect automatically; for some reason it was no longer tracking, usually it keeps tracking at least and reconnects when I get back in range. So it occurred to me to check if I could turn on a notification that the TCP/IP connection had been lost, but it doesn't appear I can. Any chance that an option could be added to send a notification when tracking has stopped for any reason besides manually pressing the stop tracking button?

Thanks and 73!

ge0rg commented 4 years ago

The normal logic is to retry connecting every 30 seconds, and the only possible reason I can see for it stopping is when Android runs out of memory.

APRSdroid would be restarted after that, but it has a special case handling of the perceived "first start" where it will abort immediately if there is no internet connection.

What you can do is to download APRSdroid Speaker, this is a companion app that will use text-to-speech to inform you of any APRSdroid events. It can be configured to track connection losses (those are "APRSdroid events").

MoTLD commented 4 years ago

Yup, that sounds exactly right, I have an old memory-constrained machine and likely APRSdroid got unloaded, and when it reloaded it seems the first start handling logic caused it to abort the connection.

I'll give APRSdroid Speaker a try, I don't want the tts because I usually run in vibrate anyway, but as long as it can pop up a notification so I see it on my Pebble, I'm good. Thanks!

MoTLD commented 4 years ago

Is there any way to prioritize APRSdroid's tracking thread within Android so that it doesn't get unloaded when the system runs low on memory, or is that sort of low-level stuff inaccessible short of a custom kernel? My device is rooted (running CM11) if that helps.

I suppose if it was exposed to app developers, most apps would just set themselves to the do-not-unload priority and the memory management would be useless...

ge0rg commented 4 years ago

The regular way on Android is the "foreground service", for which you see the permanent notification. I fear there is not much more that can be done, except for not opening other apps while you are tracking...