Comments (5)
My Log console shows:
04-05 22:57:51.502: I/ActivityManager(916): Waited long enough for: ServiceRecord{582d1f6 u0 com.ionicframework.back546619/com.red_folder.phonegap.plugin.backgroundservice.sample.MyService}
from bgs-core.
Reference your questions;
Reference question 1;
Yes, the RegisterForUpdate will be disabled. The app can only be registered for updates during it's lifetime. If you close the app, then it is no longer alive and thus cannot receive automatic updates from the background service.
In a production application, you would automatically register for updates when the App starts. For the sample application I make it all manual so that the developer can see the moving parts.
Reference question 2 - part a - Service doesn't start in boot;
Add Log.d() statements to the BootReceiver.java or run in debug (Log.d will probably be easier). This will help us to understand what is happening on boot. I've tested on Android 5 (emulator & device) and both worked fine. I would suspect that there is something within the start up of the background service which is taking too long start - you will need to review your code.
Reference question 2 - part b - Recommendation on persistent storage;
The documentation is telling you to use persistent storage for any configuration you use for the background service (either via getConfig/ setConfig or just in your Java code).
The myService sample just uses in-memory variables - so when the service restarts (such as from boot) then it will have lost those in-memory variables.
In production code, any of those variables should be saved to persistent storage (such as shared preferences, SQLite, etc) - so that when the service starts it can read those details back in to the variables.
I hope that all makes sense.
from bgs-core.
No further activity - assume question closed
from bgs-core.
Hi.
I installed bgs-sample.But The service is not started after device reboot.And I add Log.d in BootReceiver but there is no related any messages in logcat. pls give some help or suggestions. Thks.
from bgs-core.
@ZengYJ Please do not update closed un-related issues. If you have a new issue to raise, then please create a new one. In the case of you problem - make sure that you have registered it to receive the BootReceive broadcast in the manifest
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.