1

I want to disregard the Device Time and want to implement my own Clock inside my app. The time I need will be coming from the server.

I have already set its Date and Time as follow:

Date.setDate()

and

Date.setTime()

Now, I just need to get my private Date running like a clock.

How can I do this?

EDIT: So far, I have not implemented anything as I have no idea on how to create a clock/timer starting on a specific date/time object. I am thinking of having a thread and a runnable for ticking but I don't know how to increment it to make it work just like a clock.

Dale Julian
  • 1,560
  • 18
  • 35
  • please elaborate " I just need to get my private Date running like a clock" – Pooya May 03 '16 at 09:36
  • 2
    easiest way is to just remember the difference between device time and your desired time. whenever you need time, just add the difference to the device time. – mahe May 03 '16 at 11:04
  • As for Pooya's question, I have declared a Date Object inside my class and assigned a new value to it. I need to have a clock running based on that newly assigned Date object. – Dale Julian May 03 '16 at 12:11
  • [What have you tried?](http://whathaveyoutried.com) Please [edit] your question to show the code you have written so far and where you are stuck, then we can try to help with specific problems. You should also read [ask]. – Toby Speight May 03 '16 at 16:17
  • I apologise but I haven't tried anything yet as I have no idea on how to implement it. Sorry :( – Dale Julian May 03 '16 at 23:10
  • Try mahe's suggestion to keep track of the private time easily. – Mobile Developer May 04 '16 at 01:15

0 Answers0