Announcement:

This is a Testing Annocement. I don't have Much to Say. This is a Place for a Short Product Annocement

4 Ekim 2013 Cuma

Development of applications in Android - how to start a service


public class service extends Service {}

private static final String TAG = "EjemploDeServicio";

private Timer timer;

@Override
IBinder public onBind(Intent intent) {}
return null;
}

@Override
public void onCreate() {}
() super.OnCreate(savedinstancestate);
/Etc/log.d/conf/services (TAG, "Created service");
timer = new Timer();
}

@Override
public void onStart(final Intent intent, final int startId) {}
super.onStart (intent, startId);
timer.scheduleAtFixedRate(new TimerTask() {)
@Override
public void run() {}
Log.i (TAG, "Task executed!");
}
(}, 0, 15000);
}
}



In the system log, the service in question prints the message "Executed task!". The Timer object executes a task every 15 seconds (15000 milliseconds). OnCreate creates the Timer object and initializes, whereas in onStart method scheduleAtFixedRate of the timer object is used to indicate that the task should run every 15 seconds.
Share it Please

Unknown

The world of mobile phones, applications, games android tablet computer technology with plug-ins are here to provide the most recent shares.

0 yorum:

Yorum Gönder

Copyright @ 2013 Android Mobile Phone Applications World. Designed by Templateism | Love for The Globe Press