Run Android phonegap app in background

I am developing an Android application in Phonegap, cordova .. I had a button in the application, when I click on it I need to run the application in the background and

You must call the web service at intervals of 15 minutes.

Is it possible in a telephone break, Cordoba proj ...

I am new to this. Please, help

+6
source share
3 answers

You will need to create your own plugin to run processes in the background. You can find the plugin implementation here .

+6
source

In the onCreate method of your Java class, which extends from DroidGap, make sure you set "keepRunning" correctly.

super.setBooleanProperty("keepRunning", true); 
+1
source

Compared to 3+ telephony, there is a plugin that will add this functionality to your application, here the link to the project and plugin instructions should work to build cordova, phonegap and phonegap:

https://github.com/katzer/cordova-plugin-background-mode/blob/ac5fef831dbf9e567277dc900389923bd9bc7714/README.md

+1
source

Source: https://habr.com/ru/post/924351/


All Articles