如何实现PhoneGap Android后台服务 [英] How to implement PhoneGap Android background service

查看:108
本文介绍了如何实现PhoneGap Android后台服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在此网页上实施示例

I am trying to implement the example on this page phonegap-android-background-service but so far having a problem getting it to work.

我的错误报告;

Error: Plugin unable to bind to background service

然后是javascript警报;

then a javascript alert;

ErrorCode: -4, Success: false, RegisteredForUpdates:false,RegisteredForBootStart:false,ErrorMessage: Plugin unable to to bind to background service,ServiceRunning: false

Android设备操作系统:4.2.1 jELLY Bean

Android Device os: 4.2.1 jELLY Bean

Cordova版本:2.9 RC 1

Cordova Version: 2.9 RC 1

推荐答案


1)转到Assets-> www Folder-> myService-2.7.0
设置包路径

Follow the Steps 1) Go to Assets->www Folder->myService-2.7.0 set package path

cordova.define / myService',function(require,exports,module){

CreateBackgroundService('com.yournamespace.yourappname.MyService',require,exports,module);
});

cordova.define( 'cordova/plugin/myService', function(require, exports, module) {
CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); });

更改 - > com.yournamespace.yourappname

Change ->com.yournamespace.yourappname

名称。

这篇关于如何实现PhoneGap Android后台服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆