Time Example App

This simple application displays the date and time using a TextView. The TextView must be updated with the correct time periodically so a Handler is used to schedule updates. This is accomplished by creating a Runnable class in which the public void run() method obtains the current time and updates the TextView. Handlers can schedule a Runnable to be executed after a delay, by rescheduling the same Runnable from within the run() method the time will be updated periodically.

First we will take a look through the project to see what is happening, click here to download the source.

To modify the application you will be adding another TextView that displays a timer that displays the number of seconds since the application was started.

When finished you should be able to run the application and see something like this: