Closed fsantoso closed 10 years ago
Did you amend myService-3.1.0.js to reflect the new namespace?
You'll need to amend to this:
cordova.define(
'cordova/plugin/myService',
function(require, exports, module) {
CreateBackgroundService('com.example.test_service.MyService', require, exports, module);
});
I have made such change and actually re-did the entire apps to follow your instructions exactly, but unfortunately the result remains the same. My LogCat doesn't show any of the BackgroundService actions.
I am using Cordova 3.2, would that affect anything at all?
Thanks a lot for your help.
Take a look at your config.xml
You should have something similar to:
<feature name="BackgroundServicePlugin">
<param name="android-package" value="com.red_folder.phonegap.plugin.backgroundservice.BackgroundServicePlugin"/>
</feature>
Your config.xml above doesn't look like the 3.x.x style - have you upgraded from a older version? Review the Cordova docs for the format.
Someone has used 3.1 with Cordova 3.2 before (I haven't personally). I doubt there will be problems.
It works now, thanks for pointing that out for me! Greatly appreciated.
Hi Mark, as advised, here is the sample app that generates the "class not found" error. Greatly appreciate your help.
AndroidManifest
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.test_service" android:versionCode="1" android:versionName="1.0" >
Config
Index
<!DOCTYPE HTML>
MyService V3.1.0
MyService
package com.example.test_service;
import java.text.SimpleDateFormat; import java.util.Date;
import org.json.JSONException; import org.json.JSONObject;
import android.util.Log;
import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService;
public class MyService extends BackgroundService {
}