Android Anti-Kill

Source: Internet
Author: User

Android Anti-Kill

Now the cleanup software, such as 360 has a key to clean up the function, he will run in the background of the program to kill off. The program does not go through a normal life cycle after it dies, such as calling the Ondestory method. How can the program keep running in the background without being killed by 360?

After testing several methods, we finally found a way. Android has a sync tool, Sync Adapter, which you can run periodically after registering. This way, even if your process is killed, it will automatically restart within a certain amount of time. The Android develop website has his introduction to Run the Sync Adapter periodically

You can download the official example to see how he declared the registration of the Addperiodicsync method is to add the method of cycle run

1 Long pollfrequency)

Pollfrequency is the time of the cycle, which is measured in seconds.

However, during the actual testing process, it is not necessarily the time you write, sometimes fast or slow, that is because

Although these sync is scheduled at the specified frequency, it could take longer for it to actually is started if other Sy NCS is ahead of it in the sync operation queue. This means, the actual start time may drift.

Your synchronizer will be affected by someone else's Synchronizer.

Android Anti-Kill

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.