Page 1 of 2
Turn Radio App into Clock Radio
Posted: 05 May 2017 08:15
by seven__
Hi,
i want to make my own alarm clock. Therefor i want to use the app FritzTV wich is able to play radio streams.
I was able to set a time to start the App. The App starts in the favorites tab but then i dont know how to run a certain programm
like my favorite radio stream.
Re: Inside App Control
Posted: 07 May 2017 11:10
by Martin
Hi,
You could try to use action Control UI to simulate a tap on the Energy tile.
Regards,
Martin
Re: Inside App Control
Posted: 07 May 2017 12:19
by seven__
I dont know how to simulate a tap. How does Automagic know where to tap?
Re: Inside App Control
Posted: 08 May 2017 17:58
by Martin
Hi,
You can tell Automagic to tap on a certain x/y-coordinate on screen or to tap a button with a certain text.
You can use action Control UI and the button Show Overlay Control to determine the coordinate or the label of the button. Click the red Info button to mark all components on screen with a green overlay. Tap within a green rectangle to show a list of possible interactions.
Regards,
Martin
Re: Inside App Control
Posted: 09 May 2017 10:39
by seven__
Thank you very much!
Ive got the coordinates now. My script looks like this: click(xxx, xxx);
But it doesnt do the click -.-
Re: Control UI
Posted: 11 May 2017 19:21
by Martin
I assume that you use the actual coordinates and not just xxx?
On Android 7 you could also simulate a touch using the gesture feature (use the red gesture button instead of the info button in Control UI/Overlay control).
Re: Control UI
Posted: 11 May 2017 19:23
by seven__
Of course i use not xxx

click(906, 456);
Im on Android 6
Moto G4 Play Stock Rom
Re: Control UI
Posted: 11 May 2017 19:59
by Martin
Maybe the Fritz app does not use regular Android components but paints the buttons by itself. Unfortunately I can not verify it since I don't have a Fritz box.
In this case you can only press the buttons using root permissions using Execute Root Command: input tap 906 456.
Regards,
Martin
Re: Control UI
Posted: 11 May 2017 23:21
by seven__
It works

You are brilliant.
Next problem. When the screen is off the execute Root Command: input tap 906 456 is not done.
My flow looks like this:
Time
Launch App
Execute Root Command
When i exceute it when the screen is on it works. When the screen is off nothing happens. When i log in with my pin the fritz app opens by himself.
So i guess the flow works in the background when the sceen is off until it comes to the point execute Root Command: input tap 906 456.
How can i force the execute Root Command: input tap 906 456 be done even when the screen is off?
Re: Control UI
Posted: 14 May 2017 18:49
by Martin
Simulating taps on the screen usually requires the screen to be on and unlocked. You could use action Turn Screen On to activate the screen. Unlocking can be difficult depending on lock type and Android version. Set Lock PIN/Password or Set Keyguard State works on some devices. You could also try to simulate taps to enter the PIN/password.
Regards,
Martin