Android Alarm or Background Service with JavaScript interface

156 views
Skip to first unread message

James Henderson

unread,
Jan 10, 2017, 6:50:59 AM1/10/17
to phon...@googlegroups.com
Please, has anyone got a working alarm / background service for Android that has a JavaScript interface?

Rob Willett

unread,
Jan 10, 2017, 6:56:23 AM1/10/17
to phon...@googlegroups.com
Have you looked at

https://github.com/wnyc/cordova-plugin-wakeuptimer
On Tue, 10 Jan 2017 at 11:50, James Henderson <jameshend...@gmail.com> wrote:
Please, has anyone got a working alarm / background service for Android that has a JavaScript interface?

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Henderson

unread,
Jan 10, 2017, 7:16:50 AM1/10/17
to phon...@googlegroups.com
Yes, but when I swipe this App away it disappears

On 10 January 2017 at 11:55, 'Rob Willett' via phonegap <phon...@googlegroups.com> wrote:
On Tue, 10 Jan 2017 at 11:50, James Henderson <jameshend...@gmail.com> wrote:
Please, has anyone got a working alarm / background service for Android that has a JavaScript interface?

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe@googlegroups.com.

James Henderson

unread,
Jan 11, 2017, 6:04:16 AM1/11/17
to phon...@googlegroups.com

James Henderson

unread,
Jan 11, 2017, 10:19:06 AM1/11/17
to phon...@googlegroups.com
Hi Rob

Thanks, your advice was really helpful. I have the plugin you suggested up and running now, and, sorry, I was wrong about it not working when the App is swiped away.

Two minor problems with it though:

1. It loads the App in the foreground and I can't remember how to ask it to not do that.
2. It does not work after the device is restarted.

Any help on these would be amazing!

PS. Please ignore my previous response from yesterday (it was a long day) - we wrote a background service that connects to the SQLite Cordova plugin (link in previous message) with a JS interface, but the boss here said it sounds like too much work to maintain and completely different to an iOS Background Fetch - plus not very secure etc.

James Henderson

unread,
Jan 11, 2017, 11:45:50 AM1/11/17
to phon...@googlegroups.com
Sorry again - it does load at startup, but you have to manually change the startup permissions (if the App is not installed via Google Play Store)

Rob Willett

unread,
Jan 11, 2017, 1:35:23 PM1/11/17
to phon...@googlegroups.com
I would suggest contacting the plugin author. We don't use that plugin directly but as part of a commercial GPS plugin.

Chris is pretty good at responding and his code is very good. Tell him hi from Rob in London :)

Rob

James Henderson

unread,
Jan 12, 2017, 10:41:39 AM1/12/17
to phon...@googlegroups.com
Hi Rob

I am not sure how to contact Chris, the visible contributors for your recommended plugin have different names, but I like your sentiment. I have posted a note on their github Issues area but if anyone else knows how then please help.

Does anyone have any experience with this cdvStartInBackground in MainActivity.java please?

        Bundle extras = getIntent().getExtras();
        if (extras != null && extras.getBoolean("cdvStartInBackground", true)) {
            moveTaskToBack(true);
        }

Reply all
Reply to author
Forward
0 new messages