Thursday, March 6, 2014

How to make the service has been running android


such as the title, how to get android's service has been running in the background, even if the activity has already been finish off the main process or application user has been cleared away, and I also let the service run in the background. In addition, if the user shuts down after restarting the service, I also think this started. After I tried a lot of ways, just beginning to use localservice not found, then switch to remoteservice, after the discovery after calling startservice my activity drained away, the service is still running, but I cleared the application of the service stopped. I would like to ask you to do android brother, service in addition to start activity there something else you can do to start service? I checked the Internet say with Intent.ACTION_TIME_TICK this broadcast can be achieved after stopping off at the service restarts, but that seems to only broadcast dynamic registration, I had to lift in ondestroy after registration activity in ontart, which imply that the I did not start this activity with the broadcast will not work if this is the case or not achieve their goals. <-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Big Brother help explain it
Reply:
With radio receivers
Reply:
With broadcast receivers, then listen what action?
Reply:
Some systems monitor frequently called action, or use Daemon
Reply:
Can you give hair a demo, I qq-mail 1254877260@qq.com. Whole for several days, but has not been successful, I cleared up after the application, service and does not call it stopped the service of Ondestroy method, if the application is not cleared after the activity ondestroy service can also run
Reply:
After the answer will be a reward and reward rich
Reply:
system / core / rootdir / init.rc file the final surface is a series of code to define some service, the service can be activated when the specified operation mode, as

service preinstall / system / bin / sh / system/etc/init.my.system2data.sh (Note: This script I define it as a service)
class core / / core of this class represents a random start and start, if designated as a main (specifically what I can not remember) you can always run

No comments:

Post a Comment