Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4006838
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:33:43+00:00 2026-05-20T08:33:43+00:00

UPDATE: After adding the suggested methodes ( doBindService() and doUnbindService() ) along with calls

  • 0

UPDATE:

After adding the suggested methodes (doBindService() and doUnbindService()) along with calls to no avail) From here suggested by @Nick Campion

I’ve been trying for a while to get this service running but nothing seems to be working – I know I’m probably missing a semicolon or something 🙂

The program calls startNotificationService(), then the Log shows the log message… and the app continues to run without the Service showing up. I can’t find the Service in Advance Task Killer. HELP!!!

XML (In Manifest) :

    <service 
        android:icon="@drawable/icon" 
        android:label="Smart Spdate Service"
        android:name="notifyService">
    <intent-filter 
        android:label="FULL_PATH_NAME_HERE.updateService">
    </intent-filter>
</service>

Service Call

    Log.v("NOTICE", "Notification Service was not found running - starting");
    //startService(new Intent(this, notifyService.class));
    startService(new Intent(notifyService.class.getName()));
    //startService(new Intent(TweetCollectorService.class.getName()));

     /* FROM GOOGLE */
     void doBindService() {
    // Establish a connection with the service.  We use an explicit
    // class name because we want a specific service implementation that
    // we know will be running in our own process (and thus won't be
    // supporting component replacement by other applications).
    this.bindService(new Intent(this, updateService.class), mConnection, Context.BIND_AUTO_CREATE);
    mIsBound = true;
}

void doUnbindService() {
    if (mIsBound) {
        // Detach our existing connection.
        unbindService(mConnection);
        mIsBound = false;
    }
}
/* END OF GOOGLE CODE */
@Override
public void onDestroy() {
    web.close();
    doUnbindService(); // Added to `onDestroy` - suggested by Google page
    super.onDestroy();
    Log.v("NOTICE", "PROGRAM TERMINATED");
}

updateService.java

public class updateService extends Service {
private String TAG = "SERVICE";
public static final int INTERVAL = 60000;
private Timer timer = new Timer();
private static updateService Pointer;

public updateService() {
    Pointer = updateService.this;
}

public static class LocalBinder extends Binder {
    static updateService getService() {
        return Pointer;
    }
}

@Override
public void onCreate() {
    super.onCreate();
}

@Override
public void onDestroy() {
    if (timer != null) {
        timer.cancel();
    }
    super.onDestroy();
}

@Override
public void onStart(Intent intent, int startId) {
    timer.scheduleAtFixedRate(new TimerTask() {
        public void run() {
            doStuff();
        }
    }, 0, INTERVAL);
    super.onStart(intent, startId);
}

public void doStuff() {
    Log.v(TAG, "doStuff");
}

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

private final IBinder mBinder = new LocalBinder();

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:33:44+00:00Added an answer on May 20, 2026 at 8:33 am

    I don’t see anywhere where your client binds to your service. Take a look at the local service example.. The reason for using the bind pattern even though you call startService is because the startService call is asynchronous. You need to make an additional call to bind the service to make sure you get a call back once the startup is complete.

    I’ve found that a really great example of a service client and service are available in the NPR Open Source App for you to learn from!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Strange problem here... UPDATE After adding a lot more server side debugging, I found
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here:
Does anyone know what the esiest way to update the entity model after adding/deleting
I am suddenly getting the following errors from SQLite after adding a new transaction:
I am getting a strange exception when trying to update a DataTable after flagging
After some time I wanted to update my git repo, and then something went
After running a insert or update query against a SQLServer 2005 database, under what
Say I have a controller with an Index Method and a Update Method. After
I'm using Subversive plugin in Ganymede, but after today's update it stopped working -
I've encountered a problem with my Netbeans 6.1 IDE. After an unsuccessful update, Netbeans

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.