I have created an activity which sets two times: TimeOn and TimeOff, -these are global variables stored as Long. Example data would be (24H clock)
TimeOn=22:00
TimeOff=06:00
I want to pass these two values to a service which runs all the time. It should check the current time and if it is later than TImeOn, then turn on FlightMode and if later than TimeOff (the next morning), turn it back off again. This should happen every day.
Questions:
1. How do I check the time? Using DateUtils?
2. Should my global variables be in the service?
Any help would be great. Many thanks.
Mark
TimeOn=22:00
TimeOff=06:00
I want to pass these two values to a service which runs all the time. It should check the current time and if it is later than TImeOn, then turn on FlightMode and if later than TimeOff (the next morning), turn it back off again. This should happen every day.
Questions:
1. How do I check the time? Using DateUtils?
2. Should my global variables be in the service?
Any help would be great. Many thanks.
Mark