Enable Safety assistance emergency mode

孤街醉人 提交于 2020-01-31 04:36:29

问题


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.



来源:https://stackoverflow.com/questions/28556608/enable-safety-assistance-emergency-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!