Code Monkey home page Code Monkey logo

Comments (5)

Red-Folder avatar Red-Folder commented on June 17, 2024

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.

Skeldave avatar Skeldave commented on June 17, 2024

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.

Red-Folder avatar Red-Folder commented on June 17, 2024

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.

Red-Folder avatar Red-Folder commented on June 17, 2024

I checked it on my test bed and it all seems to work fine with 5000

from bgs-core.

Red-Folder avatar Red-Folder commented on June 17, 2024

No update since July - so closed

from bgs-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.