Run Android phonegap application in background
Asked Answered
L

3

6

I am developing an android application in Phonegap, cordova.. I had a button in the application, while clicking in that I need to run the application in the background and

need to call a web service at the interval of 15 mins.

Is it possible in phone gap, cordova proj...

I am new to this..Please help

Lornalorne answered 1/9, 2012 at 17:32 Comment(0)
R
6

You will have to create a custom plugin in order to run processes in the background. You can find a plugin implementation here.

Ronnyronsard answered 1/9, 2012 at 19:17 Comment(0)
B
1

In the onCreate method of your Java class that extends from DroidGap make sure you have set "keepRunning" properly.

        super.setBooleanProperty("keepRunning", true);
Bloated answered 26/11, 2013 at 5:52 Comment(0)
O
1

As of phonegap 3+, there's a plugin to add this functionality to your application, here's the link to the plugin project and instructions, should work for cordova, phonegap and phonegap build:

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

Owen answered 16/4, 2014 at 3:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.