Software Archive
Read-only legacy content
17061 Discussions

Android 5.0.1 App in background - URGENT

ale_d_
Beginner
330 Views

my app uses pushes (cordova-pushwoosh-plugin).

It seems that my app in Android 5.0.1 is closed (if I click on app in "opened app" it shows me the splashscreen) after a few seconds that the app loses focus by swapping on other apps. This maybe can cause that my app doesn't receive pushes in this state. I can only receive pushes some seconds after I put it in background, but after a while, I cannot receive pushes anymore. This is VERY bad because I need pushes everytime, because my app is for medical use.

 

Of course in the same situation, everything works well in Android 4.4.2

 

So 2 solutions:

1) prevent android to close the app

2) suggestion? what's wrong? I use cordova-plugin version 3.5.9

 

please help me is urgent because app is on stores.

0 Kudos
5 Replies
John_H_Intel2
Employee
330 Views

This sounds like an issue with the plugin. Have you tried contacting pushwoosh support?

0 Kudos
ale_d_
Beginner
330 Views
Hello not a bug. I discovered that lollipop os (5.0.1) has 'protected apps' section in settings. App marked as protected are kept running even after the restart or after the shutdown of the screen. This marking is manual...marking my app as protected fixed the problem but not completely: i have to teach this to my customers that have this os. Is there a way to set it automatically after instsllation?
0 Kudos
PaulF_IntelCorp
Employee
330 Views

Ale -- I think what you are running into is a feature on some devices that forces apps to stop, in order to save on battery life or a task-killer app installed by the user. I am not aware of such a feature built into standard Android. Such features are added by some OEMs and CyanogenMod or via an app that has been downloaded by the end user, usually to get longer battery life. For example, see the screenshot of such an app on Asus devices > https://software.intel.com/en-us/xdk/faqs/debug-test#autostart-app-prevew and see this article regarding such apps > http://www.howtogeek.com/166140/you-dont-need-to-install-a-task-manager-how-to-manage-running-apps-on-android/

Can you provide some screenshots from the device showing what you are doing when you say you are in the "protected apps" section of settings? I cannot find any such feature on either Android 5 or Android 6.

0 Kudos
ale_d_
Beginner
330 Views
Hello paul. Yes this is a huawei lollipop 5.0.1 feature. Anyway is it possible to create services by intel xdk?
0 Kudos
PaulF_IntelCorp
Employee
330 Views

Ale -- I don't follow your question. What sort of services to you mean? Do you mean is it possible to create background Android services? Or are you referring to interacting with web RESTful API services? Please clarify. If you mean Android background services, the answer is "no." The XDK can only be used to build your HTML5 code. To build a background service you need to create a custom plugin. For example, there is a popular geo background plugin that allows for the collection of geo data while the app is not running, it is a Cordova plugin that is part of your app, but it is structured as an Android service so it can collect data continuously. Likewise, most push notification services would work the same way.

0 Kudos
Reply