Turn Radio App into Clock Radio

Post your questions and help other users.

Moderator: Martin

User avatar
seven__
Posts: 12
Joined: 15 Jan 2017 11:38
Location: Hamburg

Turn Radio App into Clock Radio

Post by seven__ » 05 May 2017 08:15

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.
Attachments
Screenshot_20170505-101036.png
Screenshot_20170505-101036.png (125.27 KiB) Viewed 21040 times
Last edited by seven__ on 19 May 2017 11:04, edited 2 times in total.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Inside App Control

Post by Martin » 07 May 2017 11:10

Hi,

You could try to use action Control UI to simulate a tap on the Energy tile.

Regards,
Martin

User avatar
seven__
Posts: 12
Joined: 15 Jan 2017 11:38
Location: Hamburg

Re: Inside App Control

Post by seven__ » 07 May 2017 12:19

I dont know how to simulate a tap. How does Automagic know where to tap?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Inside App Control

Post by Martin » 08 May 2017 17:58

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

User avatar
seven__
Posts: 12
Joined: 15 Jan 2017 11:38
Location: Hamburg

Re: Inside App Control

Post by seven__ » 09 May 2017 10:39

Thank you very much!
Ive got the coordinates now. My script looks like this: click(xxx, xxx);
But it doesnt do the click -.-

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Control UI

Post by Martin » 11 May 2017 19:21

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).

User avatar
seven__
Posts: 12
Joined: 15 Jan 2017 11:38
Location: Hamburg

Re: Control UI

Post by seven__ » 11 May 2017 19:23

Of course i use not xxx :)
click(906, 456);

Im on Android 6
Moto G4 Play Stock Rom

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Control UI

Post by Martin » 11 May 2017 19:59

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

User avatar
seven__
Posts: 12
Joined: 15 Jan 2017 11:38
Location: Hamburg

Re: Control UI

Post by seven__ » 11 May 2017 23:21

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?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Control UI

Post by Martin » 14 May 2017 18:49

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

Post Reply