AutoInput How to auto switch on or off Mobile Data (not toggle(

Discussion in 'AutoApps' started by Felixchang, Feb 15, 2017.

  1. Felixchang

    Felixchang New Member

    Hi,
    I wonder if any one has example solution on how to switch off or on the mobile data using AutoInput and Tasker.
    Normally I would like to specify that once the desired WIFI connection is detected, then explicitly turn off the mobile data (regardless of current state of mobile data). Toggle of mobile data will not work some times because for some reason, it the state of mobile data is off, it will toggle it to be on.
    Tasker alone used to work well but since the newer version of Android no longer support this, I wonder if there is some simple way out.
    I looked through some examples in the AutoApps web site but they all seem to be example of toggling.
    I noticed there is a way to query the state of mobile data and then flash it as text but not sure how can I use this for my purpose.
    Any help is appreciated
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    By gettting the current state it's just a matter of not doing anything if the state is already off :) hope this helps!
     
  3. Felixchang

    Felixchang New Member

    Is there any way to explicitly turn the mobile data on or off but not toggling?
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Yes. Check the state. If it's already off and you want to turn it off just don't toggle it :p
     
  5. Felixchang

    Felixchang New Member

    Ok. How do I do that ?
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Which part exactly?
     
  7. Felixchang

    Felixchang New Member

    How do I perform a check on the status of mobile data status, depending on if it is on or off, then will take the next action to toggle it or not.
    Do you have similar examples I could follow ?
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    But in the OP you said "I noticed there is a way to query the state of mobile data and then flash it as text but not sure how can I use this for my purpose.". I thought you knew how to do this already?
     
  9. Felixchang

    Felixchang New Member

    Yes. This is the example I saw. But after getting the variable status, how do I use this to check before doing a toggling ?
    The example only showed how to get the variable, then flash it. How to use this to do a check ?
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    What is the variable's value when you check?
     
  11. Felixchang

    Felixchang New Member

  12. joaomgcd

    joaomgcd Administrator Staff Member

    Add an If action in Tasker and set the condition to %status matches ON and inside the If switch the mobile data to off. If it doesn't match ON don't do anything :)
     
  13. Felixchang

    Felixchang New Member

    Thanks. I have done something similar last few days but just can not get it through.
    Now for instance, if I go to mobile data setting and set the ticked field variable called checkon, I see the following code:
    Only Visible:false
    Only Clickable:false
    App Package:com.android.phone
    Check Screen State:false
    Vairables:checkon()
    When I define a if statement in tasker such as
    %checkon() ~ ON
    On the task screen, to the extreme right, there is a red mark indicating probably syntax error so I can not execute it.
    In the edit menu, if I press the "coffee icon" icon, it says nothing found.
    I tried with value OFF also with the same error.
    Am I doing the right thing ? What kind of value should I assign to match ?
     
  14. joaomgcd

    joaomgcd Administrator Staff Member

    Can you show me a screenshot of that error? Thanks
     
  15. Felixchang

    Felixchang New Member

    Thanks. I have done something similar last few days but just can not get it through.
    Now for instance, if I go to mobile data setting and set the ticked field variable called checkon, I see the following code:
    Only Visible:false
    Only Clickable:false
    App Package:com.android.phone
    Check Screen State:false
    Vairables:checkon()
    When I define a if statement in tasker such as
    %checkon() ~ ON
    On the task screen, to the extreme right, there is a red mark indicating probably syntax error so I can not execute it.
    In the edit menu, if I press the "coffee icon" icon, it says nothing found.
    I tried with value OFF also with the same error.
    Am I doing the right thing ? What kind of value should I assign to match ?
     
  16. Felixchang

    Felixchang New Member

    Hi,
    This is the full workflow.
    1. I went to mobile setting screen shot 1 and 2
    2. Then I select the field Array:Checkbox not Checked (off). See screen shot 3
    3. I then defined the variable to be "checkbox". I then look at the name again to confirm. See screen shot 4
    4. Now my configuration is as shown in screen shot 5
    5. I then open the task to so a if statement and select the check box field and put the required condition. See screen shot 6, 7, 8
    6. On tasker, you can see that to the extreme right of the if statement, there is a red bar indicating some error. See screen shot 9
    Hope all is clear
     

    Attached Files:

  17. joaomgcd

    joaomgcd Administrator Staff Member

    That red bar is not important :) Don't worry about it. Can you add a flash action to see what %checkbox() contains? Thanks
     
  18. Felixchang

    Felixchang New Member

    Very strange. I took away the if statement and add a flash command. But nothing run.
    See the screen output. Below there is a stop button and the process just stays there. Nothing is flashed.
     

    Attached Files:

  19. joaomgcd

    joaomgcd Administrator Staff Member

    It seems you're not opening the screen where you toggle the data first, right? You have to open that screen, AutoInput can't do that for you.
     
  20. Felixchang

    Felixchang New Member

    Ok. I guess I will need to buy a product called AutoApps Share ? Is this correct ?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice