Get information at once rather than asking for each piece

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

Moderator: Martin

Locked
ZSasha
Posts: 103
Joined: 11 Oct 2013 03:48

Get information at once rather than asking for each piece

Post by ZSasha » 20 Apr 2014 23:08

Hi Martin,

is it possible to get some information at once rather than asking for each piece by piece?

I mean we have a condition "ringer mode". By using that we can check whether a phone is in "Normal" mode, "Vibro" mode or may be "Silent mode".
But what I would like to get is just to be able to query the system "What mode the phone is currently at?" and get an answer like "Normal" or "Vibro" etc...

The same story for, let's say, "Phone Service State".
I can ask about one of each four states "In Service" , "Out of Service" etc etc but I cannot just query the current state and get a response saying "The phone is at xxx state now".

Bluetooth device connected?" is another example. I can't ask the system "Hey Automagic, tell me what Bluetooth devices are connected now?" and get a list of connected devices.

Is it something you could implement in the future?

Thanks.

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

Re: Get information at once rather than asking for each piec

Post by Martin » 21 Apr 2014 10:36

Hi,

I'm not going to add an action that makes everything available as local variables since such an action would use too much time to run and would query for a lot of stuff that won't be used by the flow in the end.
There are some actions called Init Variable... to query the state of some settings/properties, some conditions also supply the current state or additional information as variables, for example condition Phone Service State.
You could also build a utility flow that fills in some variables and call this flow from the main flow with action 'Execute Flows' with 'Return variables to the calling flow'.
What are the variables you are currently missing most that you would like to use in a flow? Connected BT device names?

Regards,
Martin

ZSasha
Posts: 103
Joined: 11 Oct 2013 03:48

Re: Get information at once rather than asking for each piec

Post by ZSasha » 21 Apr 2014 21:35

Martin wrote:Hi,

I'm not going to add an action that makes everything available as local variables since such an action would use too much time to run
Okay, I thought that Android has some functions similar to Windows where you could ask a system to enumerate all requested resources.
If you say Android works in a different way - that's fine then.
Martin wrote:What are the variables you are currently missing most that you would like to use in a flow? Connected BT device names?
Well, I hit that obstacle while I was doing some flow with bluetooth, yes. But I thought that the similar approach could be implemented for other functions as well.

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

Re: Get information at once rather than asking for each piec

Post by Martin » 22 Apr 2014 19:33

On Android most settings/information is spread in different parts of the system (the settings database, the BluetoothManager, the WiFiManager, the TelephonyManager and in many more such managers). Many methods have to be called to collect all information available in the system and each method call is a RPC between two processes. Calling hundreds such methods to make all information available to a flow would become pretty slow.

I will add new variables to condition Bluetooth Device Connected that will provide the list of connected BT devices to the flow.
I can also extend other conditions to provide more variables or add new actions Init Variable... when time permits, just let me know what's most important to you.

Locked