Android service manifest file


I created a new class called HelloService. I added this to the Android manifest.xml.

public class HelloService extends Service {
private Timer timer = new Timer();
private long INTERVAL = 5000;

public void onCreate() {


private void startservice() {
timer.scheduleAtFixedRate( new TimerTask() {
public void run() {
Log.d(“servy”, “This proves that my service works.”);
}, 0, INTERVAL);
; }

private void stopservice() {
if (timer != null){

public IBinder onBind(Intent arg0) {
return null;

My other activity calls it like this:

Intent helloservice = new Intent(this, HelloService.class);

For some reason, I put a breakpoint in my new HelloService…but it’s not even hitting. It’s not logging either.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>