Android record a background life-preserving design experience 2018

Source: Internet
Author: User

First of all, I do not recommend and do not like mobile phone applications through a variety of means of backstage keepalive, but when the product manager to determine certain and definitely put forward this demand, live application has to be resident in the background reason, but also only to bite the bullet to the background of the various mobile phone management mechanism to fight.

Background: Because the development of the application belongs to the type of medical monitoring, and monitoring of the patient is very important to a body indicator, so demand for the application not only to live in the background, but also in the background to receive the data sent by the detector, real-time for patient records, timely alarm, and in the market after the Huawei users have a consistent problem, The background connection is unstable and is being killed in the background.

For the back-end of the various means of life, in the network abound, summed up basically is the following several:
1. Turn on the service, set the service to kill rebirth;
2. Turn on the service, send the notification, set as the front desk service;
3. Double process keepalive;
4. Detect various system broadcast start-up applications;
5. Open 1 pixel activity on the screen;
6. Turn on the service, play silent Music (seven wounds fist);
7. Optimize application memory (when I don't say this truth);

These seven methods, the best is nothing but the last one, but I always habitual not to think about him, really bad habits.
The way listed here can be queried on the internet, but because the Android version of different ROM, not necessarily all can come in handy, here is not much to say.

In this campaign, a total of brands of mobile phones were involved:
随意蹂躏系:
NEXUS5, NEXUS6, Sony Z5, LG G4, LG G5, Samsung S6 S7 (not upgraded to the latest version)
尚有尊严系:
Xiaomi 5X, Meizu Note6, OPPO R11, VIVO X9 soft light double photo illuminate your beauty (...) Brainwashing is scary), Samsung J3 J5 (upgrade to the latest version), Huawei P9 P10, Glory 8 (when you do not do anything in the background, or a little touch)
宁死不屈系:
Huawei P9 P10, Glory 8 (when you're moving in the background)

For 随意蹂躏系 , please take good care, they provide the original or close to the original background management mechanism, because believe that each application will not be a demon, so, not the last resort, do not bully them;

For 尚有尊严系 the more customized third-party ROM, killing the background is also more in its custom power management mechanism, tried a lot of spiritual methods, it is difficult to eat all over the day, but these rom all left a power management whitelist, they need to ensure that their systems run smoothly, At the same time they also consider some applications have they have to say bitter (easy), so respect the limitations of the ROM manufacturer, do not be a demon, there is demand, open the white list, hello, I am good.

Finally 宁死不屈系 , this is also the biggest problem encountered, mentioned earlier that my application needs not only the resident background, but also in the background to receive the Bluetooth data sent by the device, that is, I need to play in the background of the Times.

The following story happens when I follow Huawei's display to turn on the power management whitelist, background cleanup whitelist, and ignore power optimization whitelist.

Huawei, which has been a 18-month-old, has also successfully sanctioned me:

    • The first is Bluetooth 广播模式 , when you five minutes after the screen, the background initiated by the Bluetooth scan is dormant, GG;
    • Then 连接模式 , after the screen runs for an hour, GG;

Service Rebirth + Front desk service + double process guardian, God installed in hand, still by Huawei hit the ground.
Until the end, the martial arts in the spread of such a set of 谱, wounded enemy 1000 self-loss 800, known as Seven wounds Fist: 无声音乐保活大法 ;
That is, in the service loop play a piece of silent music, cosplay is playing the music player.
Yes, Jiangzi did survive in Huawei's 18-month background management, but at the cost of soaring power consumption , as well as a multi-tasking menu cue for the music player icon.
But for my special application, the ability to stay in the background, continuously monitor the status of patients, give the most timely health tips, is the most important;

In the end, still want to talk about the background restrictions of each ROM, for developers, the most welcome of course is the original this 随意蹂躏系 , but your honey, the arsenic, this strategy if the rogue raging in the domestic market, it is estimated that the dregs are not left, so I personally feel in the domestic market environment, 尚有尊严系 The practice is very good, there is a need to manually open, picking, all by the user's decision; as 宁死不屈 for the Huawei, in order to achieve the effect of 18 months, to make this extremely brutal backstage Sanko strategy, a bit unreasonable, a bit too much.

Hope that the domestic application market rogue less and more, Android phone more and more useful (when I put a fart)



I love small white little white love big open
Links: https://www.jianshu.com/p/2fe6250a7503
Source: Pinterest
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

Android record a background life-preserving design experience 2018

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.