Enable Safety assistance emergency mode

2019-03-18 17:03发布

问题:

Its a very interesting and new thing for me to implement and learn. There are some requirement of my application. For that I have searched a lot but couldn't find proper and valuable thing or links. So i am posting my question here. The functionality are :

1) In Samsung device there is Safety Assistance menu in which you can find Emergency Mode option.

2) Now while Emergency mode at that time I want to create a one or more primary contacts to Emergency Mode. So now while holds the home and volume buttons the emergency will be activated and notify by notification.

3) Now while the emergency will be activated at the same moment GPS would be enabled automatically and the two photos of current location would be captured automatically and finally locations and that two photos will send to that contacts which are added in Emergency mode as a primary contact as a MMS.

Note : If sound recorder option will be enabled then recorded file will also send in MMS.

So if anyone knows or anyone implemented then I am very thankful to him/her. Help would be appreciated.

回答1:

I guess this is not a simple task, since the trigger is a keypress of vol+ and vol- for three seconds (if I remember correctly). I'm not sure if it is possible to hook those keys from a service (since this would a keylogger also do). However if you got this managed you just need to enable GPS by code. When done you just need to get the users position.

The next step is to let the user select some contacts where the data should been send. That should been the easest part. The next step is to make some photos and record some audio and send those data per mms to the desired persons.



回答2:

It's not possible to capture home button event from service. You can capture volume up/down event using BroadcastReceiver when phone is unlocked.

This looks like nice idea but also not doable in this way.