Can someone help me create this flow

Post your questions and help other users.

Moderator: Martin

Post Reply
icefox56
Posts: 53
Joined: 15 Aug 2017 02:56

Can someone help me create this flow

Post by icefox56 » 13 Apr 2020 03:57

Is it possible to create a flow that allows to set per app profiles.

Like, when I open an app for the first time it asks me stuff like

- Bluetooth be on/off
- WiFi be on/off
- Auto brightness be on/off (if off what should be the brightness level)
- Keep screen On
- Ringer mode be default/normal/vibrate/silent
- what should be the screen orientation
- what should be the media and call volume etc...

Once set it save it as a profile for that app. And next time I open the app those settings will automatically be applied.

I don't know where to start with this flow. Can someone give me some ideas or example flows if any of you have already created one.

The idea was inspired from this app https://play.google.com/store/apps/deta ... ettingsapp . It's a good app but if it is possible to do with Automagic then I can have one less app in my phone.

Any help would be appreciated.
Asus Zenfone Max pro M1, Stock android, Oreo 8.1, Rooted

Micky Micky
Posts: 179
Joined: 16 Oct 2019 17:38

Re: Can someone help me create this flow

Post by Micky Micky » 15 Apr 2020 13:45

Hello

http://automagic4android.com/flow.php?i ... 79116f0eb1

This flow changes the media volume whenever Duolingo app launches. It doesn't ask you anything, it just does it.

Change the app name in the trigger.
Change the action to your needs and add more actions if required.

You can reverse the changes by using "App task ended" trigger in another flow.

Hope this is of some help to you

Micky
Crude but it works.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Can someone help me create this flow

Post by Desmanto » 15 Apr 2020 19:36

If you are really into the full fledge App profiler, you are going to have a lot of work. Not only when creating the flow, but also when customizing each app profile. I used similar Xposed module - App settings in the past, which can switch on some certain setting when opening certain app. But I don't use xposed anymore, Automagic is enough. I don't customize each app, but only certain app those require extra features. And I don't make universal flow for it, i built flow based upon each app usage only.

For the customizer, I recoommend using widget instead to customize each app. Because the widget can show you current state of each app and you can use toggling method to switch on/off certain element. You can add 3 buttons for toggling state. Example :

Bluetooth
ON - OFF - Keep

Wifi
ON - OFF - Keep

Auto Brightness
ON - OFF - Keep - Set

ON/OFF is to set on/off. And keep is default profile to keep the state (don't change anything). For some option, you have set to set the manual value, which can be input using input dialog.

Design the widget to hold all the profile. But remember widget can only have maximum 8x8 action button, so you have to spread it into 2 columns to maximize the widget.


To add a new app, don't prompt at the first launch of each app. This will takes too much time. If you have 150 apps, you have to configure each one. Better keep every app to default keep, and add the app to configure using another which call this widget. This way, you can add manually only 10-20 apps you need custom profile. Since it is usually single config, this won't take as much time as configuring each app.

To store the state for each profile, you can use nested global map, There are several ways to store it, but if you are going for efficiency, you can store in map-list structure.

Code: Select all

global_app_profile = newMapFromValues(
"com.android.chrome", newList("ON", "ON", "OFF", 80),
"com.mixplorer.silver", newList("Keep", "Keep", "ON", 100) );
The order of the value is up to you, the above example, I just keep the order as bluetooth, wifi, auto brightness and brightness value. Of course put commnet in your script as the column note. The widget configuration will then set these list and add the app package name to the global map-list. Next time you open the app, trigger app task started will read this global map and set all the profile accordingly. In total, you will need at least 3 flows for this.

This only check for the starting. You can also use the ending (exiting app), for the exit state. Example turn on bluetooth, but upon exiting, keep the bluetooth on. Simply add another set of list to the same map.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply