Code Monkey home page Code Monkey logo

Comments (15)

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

I believe it will work with Build - but I've not tried it. Have a go and see if it works.

I'd be interested in any feedback

from bgs-core.

neogeo987 avatar neogeo987 commented on June 25, 2024

Thanks for the feedback!
When I tried adding it, it gave this error: "The license of the plugin must be 'MIT' or 'Apache 2.0'"

from bgs-core.

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

Ok. I think I need to amend the Plugin.xml licence node. Currently it reads "Apache 2.0 License"

I'm unable to make the change at the moment (maybe tonight).

If you want to try before then, fork the repository - make the change on your fork then try with build. If it works, then issue a pull request and I'll merge the change back in.

from bgs-core.

neogeo987 avatar neogeo987 commented on June 25, 2024

I'll let you handle the code for now. I'm tied up in the app functionality that requires this plugin at the moment, so rather let you work on it when you get to it.

from bgs-core.

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

Fair enough.

You are aware that this plugin is intended to be extended? The plugin by it's own does nothing. It requires a developer to add their own functionality on top of it

from bgs-core.

neogeo987 avatar neogeo987 commented on June 25, 2024

Yes, you mention it in the readme. So will this plugin be usable to a phonegap build user then? Or not? Adding javascript for functionality when using phonegap build is easy, but you can't add .java files and such.
I think even something like your MyService example will fill a void for phonegap build developers, because it will keep the app alive when minimized, which is the challenge. There just is no such plugin for android, but a couple for iOS. So if a phonegap build dev can just add your MyService (mock) plugin, then that will help them by keeping it alive.

Or am I misunderstanding something?

from bgs-core.

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

No my plugin won't keep the app alive.

The idea is that the plugin provides the scaffolding for a developer to write java logic which is performed as a background service.

Under Android, background services run in a separate process to the app and have a completely different life-cycle. The background service, once started, basically will continue to run until such point as it is killed off (user request or Android because it is too resource hungry). An app will run all the time it is visible on the screen - so turn of the screen or open another app then your app will likely be paused/ closed.

So a couple of constraints in using the plugin ...

  1. Logic needs to be in Java
  2. Cannot call back to the HTML/ JavaScript front-end if the app has been closed by Android
  3. Cannot interact directly with the screen (unless the HTML/ JavaScript front-end is open). You have to use notifications or force your app to reopen (dependent on user requirements.

There is nothing stopping you (or someone else) from creating a plugin which extends onto mine - which can then be used in build.

This might all make more sense once we get the plugin to work in build

from bgs-core.

neogeo987 avatar neogeo987 commented on June 25, 2024

So it's specifically interaction with the screen that keeps android apps alive?

from bgs-core.

teusink avatar teusink commented on June 25, 2024

Indeed, if you are talking about the interface (UI Thread). And Javascript
is even more strict for that matter.

2014-02-04 neogeo987 [email protected]:

So it's specifically interaction with the screen that keeps android apps
alive?

Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-34066704
.

www.teusink.org

from bgs-core.

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

I've updated the Licence. I'd be interested if Build is happier with it

from bgs-core.

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

Did you ever try this on Build?

from bgs-core.

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

Changed to enhancement. Needs to be tested on Build

from bgs-core.

danielzzz avatar danielzzz commented on June 25, 2024

It would be great if this plugin on build included your sample service - this way it could be extended from js. thx

from bgs-core.

lionlancer avatar lionlancer commented on June 25, 2024

I am commenting here just to let you all know that MyService sample is working on Phonegap Build.
Here's what I did:

  • Started with the basic app created from Phonegap CLI , but only used the www folder (other files and folders are removed, except for config.xml were moved inside the www folder)
  • Downloaded the MyService sample, copied myService.html and myService.js (not sure how js is called within the html file, it's not listed there) and pasted it in the www folder created above.
  • Updated config.xml to use myService.html as the value for <content>.
  • Also in config.xml, I added this line:
    <plugin name="git" spec="https://github.com/Red-Folder/bgs-sample.git" />
  • Compiled into zip, then upload to PGB.

The status for 'Service', 'Timer' and 'Boot' remains 'Running', 'Enabled', and 'Registered' respectively after I close the app, restart the phone and reopens the app. But 'Listen' is back to 'Unregistered'.

The sample app works but how are we going to include the Java file within the app with the directory structured for Phonegap Build? Can we use config.xml via <config-file> element (to update AndroidManifest.xml) and point it to our own Java file? If so, how?

Thanks a lot for this wonderful plugin. Your efforts is very much appreciated!

from bgs-core.

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

@lionlancer Normally I would expect you to include the relevant files in your project. The MyService example is just an example - I'd expect you to create your own .html & .js which implements the service you want to create. This you would include in you normal source

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.