I want to start a java service from a phonegap plugin so I can do some background processing for the application. I am using cordova-2.0.0 . Now i found some background service plugins for cordova-1.8.1 but they didint run in 2.0.0 . I would really appreciate if you could help me.
-- Aayush Shrestha
You definitely need a plugin to access native code of android from phonegap.
Have a look at this site: https://github.com/phonegap/phonegap-plugins/tree/master/Android
It is full with plugins. Probably you found yours on this page.
Unfortunately phonegap is being developed so fast that the plugins dont always keep up. So you either have the choice of going down in Version with phonegap to use the "old" plugin, write your own plugin or depending on what you would like to do you could start your background service already when the app itself starts, or with a delay etc.
EDIT: Check here to find the knowledge of how to write a plugin. http://docs.phonegap.com/en/2.0.0/guide_plugin-development_android_index.md.html
As for an android service(in the background) there are different ways. Depending on what you would like to do. I always like to use the ScheduledExecutorService http://developer.android.com/reference/java/util/concurrent/ScheduledExecutorService.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.