traccar / traccar-client-android

Traccar Client for Android
https://www.traccar.org/client
Apache License 2.0
665 stars 736 forks source link

Ainabutton #392

Closed ainaylo closed 1 year ago

ainaylo commented 5 years ago

Adds a preference for SOS trigger broadcast intent, and a broadcast listener for the specified intent. When valid intent is seen, SOS is sent to server.

tananaev commented 5 years ago

I don't think we can include it as it is. First of all, it should be a more generic solution without any references to specific hardware vendor. Secondly, I would prefer to hide this setting somewhere for advanced users to avoid any confusion.

ainaylo commented 5 years ago

Default intent could be changed to f.e. 'org.traccar.intent.action.SOS' or something if you have suggestions? Other than that there is no references to hw.

For hiding the pref, we're open to suggestions. Entry in the drop down menu after About?

tananaev commented 5 years ago

It would be nice to have some useful default, or no default.

As for hiding it, maybe instead of preferences we can have it in menu with a simple dialog.

ainaylo commented 5 years ago

We can leave it with no default, and as such it wouldn't register any listeners.

If we add a menu item below 'About', named 'SOS Trigger'. Once clicked it would open a simple dialog box with a) label 'Specify a Broadcast Intent that will trigger a SOS Alarm' b) textbox for the string which will then be saved to preferences c) 'Save' -button.

How would that work?

tananaev commented 5 years ago

I would name it "SOS broadcast", but yeah, sounds good.

tananaev commented 5 years ago

I just realized the you've added the code to NetworkManager, which is definitely not the right place for this.

ainatojis commented 5 years ago

Please let us know what would be the place you prefer

tananaev commented 5 years ago

Not sure, but definitely not there.