> Thanks John. I'm new to all this, so am finding this very tricky! Can someone help me make this for a small fee? Or even write it for me for a bigger fee?
I think you will know your time is 5 min fast and simply adjust for it and still be late. However I think it can be done.
On my phone I can select if the time and date is updated by the net work.
Check your android settings to see if you can do this on your device..
Please watch this beginners video and read the pocketables begginers guide (menu / info /guides) as well so you will be able understand the help to be provided..
http://www.youtube.com/playlist?list=PLjV3HijScGMynGvjJrvNNd5Q9pPy255dL
Are you rooted?
> yes, Im thinking of using variable randomize to add on a random number of minutes between 5-10 each day. Would that work?
Sure..
> yes, I am rooted and yes, I can select if the time and date is updated by the network.
That's good, it should make it a little easier..
>
> Yes, I am watching all the videos and reading lots, but im getting a bit lost with it all!
Okay then what part do you need help with?
Have you been able to construct simple profiles?
I would recommend just getting the time set part working first then add the random feature.
You will have to start with just the task for now and not worry about a time context yet. You will need to learn about variable split and variable join. Read up on these actions in the user guide. As John stated you can change the time with a shell command . Make sure you have manually turned off the auto time sync in your android settings. In the task edit tab make a new task. "Add Time" and select scripts / shell from the actions menu. In the "command" field put this..
date -s 20131020.113345
Select 'use root'
Then run the task with the play button.
Your time and date should change to
Oct-20-2013 11:33 and 45 seconds
To get it back just turn the auto sync back on..
This is the format you will have to use to change the time so the easiest way to get the proper format is with another shell command.
For testing purposes long press on the first shell command action and select "disable" now put in a second shell action with this command..
date +"%F-%T"
Select 'use root'
In the 'store output in' field put: %Adatetime
For the next action put:
Flash %Adatetime
You should get the date and time in this format..
2013-10-21-07:05:47
This is the format you will need to split / modify and then run the first shell action to set the time.
So make the task and see if your device gives the same results if it does you can try splitting and joining and see if you can get it. If you need more help paste the task you have made with what you been help with. Or ant questions on the above procedure ..
To post your task here... Long press on the task name / ( 3 dot menu with 4.0+ ) export / export description to clipboard (not XML)
The beginner mode needs to be off and the task needs to have a name to be able to export.
Rich..
In your enter task
Does anyone know a shell command or is there a tasker way of toggling on and off the auto network time and date?
Looks like you are picking this up quick... :)
> Does anyone know a shell command or is there a tasker way of toggling on and off the auto network time and date?
This is the hard part.. I did some quick looking and did not find a intent or other easy means of doing this.
The only way I can suggest is a little awkward..
Tasker should be able to open up your android settings to the correct view and you will have to emulate a screen tap.
Hopefully someone might chime in with a better way.
You will need to emulate screen taps
On Oct 23, 2013 7:18 PM, "Nick Chan" <nickc...@gmail.com> wrote:
>
> 1 last question before bed! Regarding the time variable, at lets say 5 past mid night, the time variable reads 000500. If I use the "variable add" to add 5 minutes to my time variable, the output removes the zeros at the beginning and would give an output of 1000. I need the zeros at the beginning for this to work. Am I doing something wrong?
You should be able to just split out the Minutes "05" then you will need to add some logic that says
If %min is less than 10 then variable set %min=0%min
To be a little clearer ..
> You should be able to just split out the Minutes "05"
So you should get %min2 = 05
Then after you add your time
Variable set %min2+%your_random_time ; check 'Do Maths'
Check for less than 10
Variable set%min2 To 0%min2 ; if %min2 < 10
> The only way I can suggest is a little awkward..
>
> Tasker should be able to open up your android settings
In the actions menus / settings dialogue
to the correct view
you will have to emulate a screen tap.
> Does anyone know a shell command or is there a tasker way of toggling on and off the auto network time and date?
>
I found this post and
It looks like the answer might be somewhere in here if anyone can figure it out...
The screen you show is DateTimeSettings . The checkbox "Use network-provided values" is associated to the shared preference String KEY_AUTO_TIME = "auto_time"; and also to Settings.System.AUTO_TIME
This settings is observed by an observed called mAutoTimeObserver in the 2 network ServiceStateTracker s: GsmServiceStateTracker and CdmaServiceStateTracker .
Both implementations call a method called revertToNitz() when the settings becomes true. Apparently NITZ is the equivalent of NTP in the carrier world.
Bottom line: You can set the time to the value provided by the carrier thanks to revertToNitz() . Unfortunately, I haven't found a mechanism to get the network time. If you really need to do this, I'm afraid, you'll have to copy these ServiceStateTracker s implementations, catch the intent raised by the framework (I suppose), and add a getter to mSavedTime .
So hopefully by now you have something like this.....
Time Test (75)
<get and split date/time to date -s 20131020.113345>
A1: Anchor
A2: Run Shell [ Command:date +"%F-%T" Timeout (Seconds):0 Use Root:On Store Output In:%datetime Store Errors In: Store Result In: ]
A3: Flash [ Text:%datetime Long:On ]
A4: Variable Split [ Name:%datetime Splitter:: Delete Base:Off ]
A5: Flash [ Text:%datetime2 Long:On ]
A6: Variable Set [ Name:%date To:%datetime1 Do Maths:Off Append:Off ]
A7: Variable Split [ Name:%date Splitter:- Delete Base:Off ]
<add random time>
A8: Anchor
A9: Variable Randomize [ Name:%random Min:1 Max:5 ]
A10: Variable Set [ Name:%datetime2 To:0%datetime2 Do Maths:Off Append:Off ] If [ %datetime2 < 10 ]
A11: Variable Set [ Name:%datetime2 To:%datetime2+%random Do Maths:On Append:Off ]
A12: Flash [ Text:%datetime2 Long:On ]
A13: Variable Set [ Name:%Adatetime To:%date1%date2%date3.%date4%datetime2%datetime3 Do Maths:Off Append:Off ]
A14: Flash [ Text:%Adatetime Long:On ]
A15: Run Shell [ Command:date -s %Adatetime Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A few notes.....
1. I use the anchor statements for non functional text to describe different parts of the task
2. You should always use local variables whenever possible. You will notice I used one global variable %Adatetime. I use this as a trouble shooting technique to be able to check the value of that variable in the variables tab of tasker. Then when the task is complete I remove the capital "A" . This allows you to view the value as well as check for white spaces along with the ability to copy and paste the value.