List of apps, Access Points and Bluetooth peers

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

List of apps, Access Points and Bluetooth peers

Post by mcyber » 19 Sep 2014 14:43

It would be useful to have actions to get lists of application names and package names, access points SSIDs and bluetooth names and addresses of paired devices. Maybe it is possible yet, but I'm not aware, so anyone reading and knowing how to, please sorry and please do tell me how to get these.

Use cases for these are various. Some examples:

APPLICATIONS:
(the following use case requires the package name to work, not the application name)
From the supplied list, choose which should start GPS, for example by means of a Input Dialog (Multi) and put in a separate list. Afterwards when an app is fired check if it belongs to the list, and if yes, start GPS.

SSIDs:
Select which of the configured Access Points, your device should automatically connect to, or associate a priority to each of them.

BLUETOOTH:
I don't need it personally but looks a use case similar to te above, more or less.

The idea is to avoid as much as possible to hard-code these informations into flows, and provide a more flexible interaction between Automagic and your device, via dialogs.

I've solved the APPLICATIONS and SSIDs use cases, with some workarounds and/or with the help of an external app, but I would have spared lot of time and effort if these informations were accessible from within Automagic.

Thank you to Martin for his excellent support in any situation and to anyone who would support this request.

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: List of apps, Access Points and Bluetooth peers

Post by kintrupf » 22 Sep 2014 06:16

mcyber wrote:APPLICATIONS:
(the following use case requires the package name to work, not the application name)
From the supplied list, choose which should start GPS, for example by means of a Input Dialog (Multi) and put in a separate list. Afterwards when an app is fired check if it belongs to the list, and if yes, start GPS.
This is already possible within Automagic. The Triggers App Task Started and Activity Ended both provide a Select Package menu if you click "..." next to "Package Name".
If you need the list of packages at run time, you could use the following actions:
Execute Command with command "pm list packages -e", then a Script action to split the output of the pm command into a list like "Packages = split(var, '\n')".

mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

Re: List of apps, Access Points and Bluetooth peers

Post by mcyber » 22 Sep 2014 12:56

kintrupf wrote:
mcyber wrote:APPLICATIONS:
(the following use case requires the package name to work, not the application name)
From the supplied list, choose which should start GPS, for example by means of a Input Dialog (Multi) and put in a separate list. Afterwards when an app is fired check if it belongs to the list, and if yes, start GPS.
This is already possible within Automagic. The Triggers App Task Started and Activity Ended both provide a Select Package menu if you click "..." next to "Package Name".
If you need the list of packages at run time, you could use the following actions:
Execute Command with command "pm list packages -e", then a Script action to split the output of the pm command into a list like "Packages = split(var, '\n')".
Thank you very much. Just tested it and it works perfectly ("\\n" is needed instead of "\n", but no problem). I did something similar by reading the apps folder, and it worked, although at the cost of more parsing instructions. Your solution is much more elegant and straigtforward. Yes, I need these at runtime.
Presently I'm doing the same by means of an external little app, called "List My Apps", which lists apps by their common name and icons for increased readability and let export the chosen ones in text and other formats, with templates. So, after choosing the apps you want, you can export whatever info you wish in whatever format (in my use case the selected apps' packages list, comma separated), into the clipboard and/or a file (I use the clipboard). If you use this app for one single purpose (list apps which should fire GPS) it even remembers your last choice, letting you do the minimum effort for changes. Nonetheless, Automagic implements a similar interface in some triggers, actions and conditions configuration, so it would be a very elegant and well integrated solution to have this functionality available at runtime.

Are you aware if a OS level command similar to the one you showed is available also for WiFi and BT?

Thank you again for your answer.

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: List of apps, Access Points and Bluetooth peers

Post by kintrupf » 22 Sep 2014 14:03

mcyber wrote:
kintrupf wrote:
mcyber wrote:Are you aware if a OS level command similar to the one you showed is available also for WiFi and BT?
Sorry, I don't know if there are such commands :(

mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

Re: List of apps, Access Points and Bluetooth peers

Post by mcyber » 23 Sep 2014 21:22

kintrupf wrote:Sorry, I don't know if there are such commands :(
No problem. You have been very helpful anyway, showing me that there are some specific commands to get infos besides those supplied by Linux normally. If I'll find a solution for wifi and BT I'll post.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: List of apps, Access Points and Bluetooth peers

Post by MURTUMA » 24 Sep 2014 06:11

Just a heads up..

There is DIY topic In the help section on the forums. When you find some useful commands, could you add them there. The topic's purpose is to collect them for easy finding.

Thanks.

mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

Re: List of apps, Access Points and Bluetooth peers

Post by mcyber » 24 Sep 2014 09:45

MURTUMA wrote:Just a heads up..

There is DIY topic In the help section on the forums. When you find some useful commands, could you add them there. The topic's purpose is to collect them for easy finding.

Thanks.
Thank you for the hint. Unfortunately I couldn' find any useful command there. I have solved for wifi, reading wpa configuration within Execute Root Command action, firing cat /data/misc/wifi/wpa_supplicant.conf (in my phone) and parsing the result variable (stdout). It works reliably. Probably something similar is also possible for BT.

Locked