I need to create two clocks - one that runs off of network time and one that is local to the device's hardware, such that if you were to unplug/take the battery out of my device, leave it out for an hour, and then turn it back on, the network clock will sync to the network and display the correct time, but the hardware clock will need to be be reset (probably by using this network time).

MY QUESTION

I was looking into Android's TextClock widget and I think I can use it for one of these two clock examples, but I can't find any documentation saying how the widget gets its time.

Can anyone help, and possibly suggest an alternative (ie a network clock if this is hardware, or vice-versa)?