1

I know this is a really old question, but I don't see a clearly answer. Any solution about keeping android app running in background on china devices seems to be not working, so I think about contacting these manufacturer to whitelist my app. Can anyone show me how to do that?

P/s: I know an app can run in background without whitelist (I'm not sure about this, but it's not in list app with auto-start permission when I check), that's Zalo (https://play.google.com/store/apps/details?id=com.zing.zalo), another app can run in background on Oppo device, but not on Xiaomi device(Xiaomi Redmi 4X, with Android 7.1.2, MIUI Global 9.2), that's VN Ngay nay(https://play.google.com/store/apps/details?id=com.xb.topnews), so I still hope there's a way to keep app running in background, please comment if you know, thanks!

  • AFAIK There is no way to turn on `AutoStart`. You need send the user to setting so that they can manually turn it on. And i can not say much about These devices i also faced some weird behavior also on these devices. Like on Reboot i was not able to receive any notifications unless i open my app manually once . – ADM Jul 10 '18 at 04:03
  • Please refer this [link](https://stackoverflow.com/a/9510829/4748607) – Nirav Bhavsar Jul 10 '18 at 04:19
  • @ADM I know that way but it's not a good solution. 2 apps I mentioned above don't need to turn on auto-start permission, and also not in list app with auto-start permission available by default like Facebook, Messenger,..but they still can run in background. I don't know how can they do that – Tiến Nguyễn Hữu Jul 10 '18 at 06:54
  • @NiravBhavsar that's not a solution. There are too many China device, I can't block them all. – Tiến Nguyễn Hữu Jul 10 '18 at 06:55
  • 1
    this may help you: https://stackoverflow.com/a/50291806/7579041 – Amin Pinjari Aug 24 '18 at 06:46

3 Answers3

1

There is no way to do that, unless you contract XiaoMi and other mobile phone manufacturers for Business cooperation 。 I am used to be a developer in XiaoMi,and exactly I wirte some code about this. I am very sorry to say, as I know,a normal android developer can do nothing for this.

XC.xc
  • 101
  • 1
  • 7
  • So for Xiaomi, how can I contact them? through email or something? I'm asking for a big company – Tiến Nguyễn Hữu Jul 10 '18 at 06:45
  • @Tiến Nguyễn Hữu You can posted a new topic on http://en.miui.com/forum.php to contact them. The developers of XiaoMi see the forum every day. – XC.xc Dec 12 '18 at 03:18
  • do they ask for money for this to happen or need to follow specific guidelines in coding or showing them source code for example, If you made it to make your app gets whitelisted tell me what did it take for it to happen, Thanks in advance. – Mohamed Alaa May 20 '20 at 02:58
0

job scheduler,firebase dispatcher like services will work in the background so you can use these services to run your service in the background

MarGin
  • 2,078
  • 1
  • 17
  • 28
-2
'<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="android.permission.WAKE_LOCK" />'

Add these two permissions in your manifest file it may work.

RANAJEET BARIK
  • 185
  • 2
  • 7