-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BootReceiver not worked #11
Comments
? |
Sorry, I hadn't noticed your issue. I'll have to have a dig through the code, but the most obvious thing would be to add some logging to the register function (within BackgroundService.java) if there isn't already any in there. Then add additional logging to the Boot Receiver. |
Had a quick look at the code; Within BootReceiver.java add some Log.d statements to show if the onReceive method is actually hit. Potentially worth also adding Log.d statements to the PropertyHelper.java in getBootServices, addBootService and isBootService. These methods are responsible for saving & retrieving if it should shouldn't start on boot. Then use the log cat to check firstly that the boot start is being set, then secondly that the BootReceiver is called when the device starts and then that is attempts to start the service. |
Thank you, |
Ok - that is a steep learning curve. You need to learn how to develop Android application using Eclipse & Java. I'd suggest learning these things (searches on google will prove better than me trying to explain them) - assuming you haven;t already:
Once happy with the above, then come back to your phonegap application and use the skills you've learnt to use the logcat to diagnose the problem within your app. You may see a warning or an error in the logcat if you javascript is badly formed. If not, then you'll want to look for the debug messages (my code is fairly saturated with Log.d statements). If still getting stuck, then post up the locat results. |
Hi, java.lang.RuntimeException: Unable to instantiate service com.red_folder.phonegap.plugin.backgroundservice.RastreadorService: java.lang.ClassNotFoundException: Didn't find class "com.red_folder.phonegap.plugin.backgroundservice.RastreadorService" on path: DexPathList[[zip file "/data/app/tmz.rastreador-2.apk"],nativeLibraryDirectories=[/data/app-lib/tmz.rastreador-2, /vendor/lib, /system/lib]] |
It can't find the service name properly. Is it named correctly? It this error occurring on boot. |
This application I had first developed in java and eclipse, but then switched to html5. Ellipse in the logcat I've used without problems. I just did not know how to use logcat with phonegap. I just saw on google that I could run a "monitor" command and it will open the Android Debug Monitor But thanks for your step by step ps.: Sorry, my english is not very good! |
Sorry for the delay; There is a difference in your package name at the top iof RastreaderService.java. Within the file it reads: com.red_folder.phonegap.plugin.backgroundservice.services Yet your folder structure and the error in the logcat seems to be expect it to be: com.red_folder.phonegap.plugin.backgroundservice Basically, remove the ".services" from your package name |
No response since June - assumed closed |
Hi,
After restarting the phone, the service is not starting.
Please, can you help me?
Follow my file AndroidManifest.xml
![clipboard01](https://cloud.githubusercontent.com/assets/1831068/3132444/67226e26-e80f-11e3-913f-5bb90024ad9d.jpg)
Follow my file service.js
var MyBackgroundService = MyBackgroundService || {};
(function() {
"use strict";
}());
MyBackgroundService.Init()
The text was updated successfully, but these errors were encountered: