Why does your service need to run all the time? That's pretty rare,
and is going to impact battery life.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
onDestroy() can still be called.
If an activity calls stopService(...), the service's onDestroy may be
called.
On May 28, 12:24 pm, Gautam wrote:
> Thanks...
> The plan is to start the service once (startService()) and never call
> stopService. I want my service to be running always (will set
>
Can some one please respond? Appreciate it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from thi
Thanks...
The plan is to start the service once (startService()) and never call
stopService. I want my service to be running always (will set
service.forground() = true).
When any activity wants to use the service it would get the service
via bind and invoke methods on the service.
Also, by looki
On Thu, May 28, 2009 at 7:12 AM, Mike Hearn wrote:
>
> Your understanding is wrong - your service can be killed at any time
> without onDestroy being run. I'm not actually sure why onDestroy even
> exists in this case, I found it was much more common for the kernel to
> OOM kill my process than i
Your understanding is wrong - your service can be killed at any time
without onDestroy being run. I'm not actually sure why onDestroy even
exists in this case, I found it was much more common for the kernel to
OOM kill my process than it was for the AM to nicely request my
service to quit. Don't s
Then you should call join() in onDestroy after calling
myBackgroundThread.stopThread() causing onDestroy to wait until your
background thread to end.
Make sure that your background thread never blocks or takes too long
to shut-down. If onDestroy is waiting too long, your user's ain't
gonna be hap
I need to make sure, that onDestroy returns only after proper clean up
by the background thread.
Else (according to my understanding) OS may kill the process hosting
the service before proper cleanup.
--~--~-~--~~~---~--~~
You received this message because you are
Send a message to your background thread telling it to end.
Your background thread:
class MyBackgroundThread extends Thread {
...
...
private boolean _isRunning = true;
public void run() {
...
...
while (running()) {
... // fetch and handle messages. ...
}
}
..
pr
Can I use the thread.join() mechanism?
Basically, in the onDestroy() method of the service, I would send a
message to the background thread and call join on the thread.
The background thread would destroy it self after proper cleanup. But,
what method should I use to exit the thread.
Please note t
Android may kill the process and thus the service running in the
process, once onDestroy() returns (after sending a message to the
worker thread).
But how will I make sure that the service has completed it's clean up
operations (ex. saving some data on to some storage, etc...), if any?
The main t
Blocking in onDestroy() waiting for the background thread to complete
basically defeats the purpose of doing work in a background thread.
On Tue, May 26, 2009 at 7:09 AM, Gautam wrote:
>
> Hi,
>
> I'm implementing a service that contains a thread to handle all
> time consuming operation. My c
12 matches
Mail list logo