Comments (5)
Q1) Removing sample plugin - I think you remove the plugin using the Codova CLI. I've never needed to do, so I can't advise - I'd suggest a search
Q2) Timer running every 60 seconds rather then 5. Yes possibly there is a clash between your code and the same. I can't see a reason why it would ignore the 5000
Q3) Database access - you need to do the work within the doWork method as Java. The background service (and thus the doWork) will have no JavaScript interpreter if the app has closed.
from bgs-core.
Thanks for the reply. I wanted to use your sample plugin for a base and just build on top of that because I know it works, rather than remaking everything.
In BackgroundServicePlugin logic there is this piece of code which suggests that 60000 is always going to be present. I don't exactly understand the code but its a thought.
public ExecuteResult enableTimer(JSONArray data)
{
ExecuteResult result = null;
int milliseconds = data.optInt(1, 60000);
Thanks again.
from bgs-core.
optInt is being provided a default if the JSON value cannot be converted to an interger - see -> http://www.json.org/javadoc/org/json/JSONObject.html#optInt(java.lang.String, int)
Are you able to add some log.D statements within the enableTimer to check the contents of the data variable and what the milliseconds actually gets set to?
from bgs-core.
I checked it on my test bed and it all seems to work fine with 5000
from bgs-core.
No update since July - so closed
from bgs-core.
Related Issues (20)
- Error Occurs on startService(success,failed) ;
- Backgound service stops when the app is terminated HOT 2
- creating multiple service class HOT 2
- Does this plugin works with local notifications? HOT 2
- Integrating with NotificationListenerService would it work?
- If Background Service is Running Through Any Local Notification or Alerts?
- Where to put MyService.java in IONIC? Android is unable to find/bind. HOT 2
- Error on Boot
- Its not working in Android 10 HOT 1
- running cordova inside of a service HOT 5
- What is service will not running when app closed ? HOT 8
- It's Possible MyService.java Call Javascript Function ? HOT 3
- ideas to make a service to continue receiving push notifications HOT 2
- Build Android Error HOT 13
- Add method onCleanup to override
- Can I load a third party android library?
- Service starting but restart on exit failing
- Application run but factory is empty
- How to stop a Countdown when the App is backgrounded (Xamarin forms) HOT 2
- Detect the volum up pression in background service
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bgs-core.