Page 1 of 1
Lock screen on bike
Posted: 27 Apr 2015 08:48
by eldron
Hi,
I have already set up some basic flows with automagic and they all work well.
Now I am trying to set up another flow to lock the screen, whilst using my phone in an outdoor (bike) cover, that covers all the hardware keys, so I can´t use the power button to lock the screen.
I want to be able to use it whilst my map app is open, so a button on the homescreen is no help.
My first approach was to use the proximity sensor, but sadly the outdoor cover renders it useless.
I am using a samsung phone, so the only hardware button i can reach is the home button, which i use to unlock the phone.
Any ideas on how I could solve this?
Can I somehow set a double click to lock the screen or maybe use the home button?
Re: Lock screen on bike
Posted: 27 Apr 2015 19:26
by Martin
Hi,
You could create a custom widget in Automagic that contains one clickable action to lock the screen and display this widget with an action
Show Custom Widget Overlay somewhere over the map app where the widget does not interfere too much.
A short tutorial to create a widget can be found here:
http://automagic4android.com/en/help/cr ... tom-widget. Adding actions is covered in Step 4.
You could also try to trigger a flow when double-clicking the home button shows S Voice. To do this, use trigger
UI Event, set Event to
Window opened and set package to
com.vlingo.midas (S Voice).
Regards,
Martin
Re: Lock screen on bike
Posted: 27 Apr 2015 21:31
by eldron
Hi Martin
thanks for your quick help and of course for you awesome app!
I am totally amazed to see what this app can do and it´s great fun to create a flow and watch it do it´s magic - 3 Euros well invested!
The widget solution works like a charme! I set it to a low opacity, so I can still see everything on the map but know where to click.
I also tried the home button (S Voice) approach. It does work to lock the screen, but when I unlock it I obviously get back to S Voice instead of the map. Not just that, the screen also gets locked again, until i managed to kill the app using the back button.
To fix that problem I put a "kill app" and even a "kill app process" into the flow, but that didn´t really work, the app stays open. Any ideas why?
I am happy with the widget solution, but I am also curious as to why the "kill app" doesn´t work (phone is rooted, other root functions work fine -e.g. start Gps / mobile data).
Re: Lock screen on bike
Posted: 28 Apr 2015 18:56
by Martin
Hi,
Opps, I did not anticipate the endless S Voice->lock->S Voice loop, sorry about that.
Kill App can only kill apps in the background but not foreground apps or apps running as a foreground service (like music players with a notification icon). The chances for Kill App Process: KILL(9) to work are slightly better but Android often restarts apps that have been killed with this method. On a rooted device it's usually working best to use Execute Root Command: am force-stop <packagename>. However, since S Voice is a system app it could also be restarted by the system. Maybe a simple action Show Home Screen to hide S Voice before locking the device could work.
Regards,
Martin
Re: Lock screen on bike
Posted: 28 Apr 2015 20:52
by eldron
Thanks for your help.
I think I´ll stick with the widget solution, as that works really well and the S Voice solution would require too many undesirable workarounds.
When I am on the bike I need the solution to work well, as I don´t have time to fiddle around with the phone.