serverpublic class Clock1Activity extends Activity { /** Called when the activity is first created. */ private Timer timer; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final TextView txtHour = (TextView)findViewById(R.id.TxtHour); final TextView txtMinutes = (TextView)findViewById(R.id.TxtMinute); final TextView txtSeconds = (TextView)findViewById(R.id.TxtSeconds); final TextView txtMilliseconds = (TextView)findViewById(R.id.TxtMilliseconds); timer = new Timer("DigitalClock"); Calendar calendar = Calendar.getInstance(); // Get the Current Time final Runnable updateTask = new Runnable() { public void run() { final Integer hora = new Integer(Calendar.HOUR_OF_DAY); final Integer minutos = new Integer(Calendar.MINUTE); final Integer segundos = new Integer(Calendar.SECOND); final Integer milisegundos = new Integer(Calendar.MILLISECOND); txtHour.setText(hora.toString()); txtMinutes.setText(minutos.toString()); txtSeconds.setText(segundos.toString()); txtMilliseconds.setText(milisegundos.toString()); } }; timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { runOnUiThread(updateTask); } }, 1, 1000); } rth-america.pool.ntp.org server 1.north-america.pool.ntp.org server 2.north-america.pool.ntp.org server 3.north-america.pool.ntp.org