├── 1.8.1 ├── backgroundserviceplugin.jar ├── myService.js ├── MyService.java ├── README.md ├── backgroundService.js └── index.html ├── 2.0.0 ├── backgroundserviceplugin-2.0.0.jar ├── myService-2.0.0.js ├── MyService.java ├── README.md ├── index-2.0.0.html └── backgroundService-2.0.0.js ├── 2.2.0 ├── backgroundserviceplugin-2.2.0.jar ├── myService-2.2.0.js ├── MyService.java ├── README.md ├── index-2.2.0.html └── backgroundService-2.2.0.js ├── 2.3.0 ├── backgroundserviceplugin-2.3.0.jar ├── myService-2.3.0.js ├── MyService.java ├── README.md └── index-2.3.0.html ├── 2.4.0 ├── backgroundserviceplugin-2.4.0.jar ├── myService-2.4.0.js ├── MyService.java ├── README.md └── index-2.4.0.html ├── 2.5.0 ├── backgroundserviceplugin-2.5.0.jar ├── myService-2.5.0.js ├── MyService.java ├── README.md └── index-2.5.0.html ├── 2.6.0 ├── backgroundserviceplugin-2.6.0.jar ├── myService-2.6.0.js ├── MyService.java ├── README.md └── index-2.6.0.html ├── 2.7.0 ├── backgroundserviceplugin-2.7.0.jar ├── myService-2.7.0.js ├── MyService.java ├── README.md └── index-2.7.0.html ├── 2.8.0 ├── backgroundserviceplugin-2.8.0.jar ├── myService-2.8.0.js ├── MyService.java ├── README.md └── index-2.8.0.html ├── 2.8.1 ├── backgroundserviceplugin-2.8.1.jar ├── myService-2.8.1.js ├── MyService.java ├── README.md └── index-2.8.1.html ├── 2.9.0 ├── backgroundserviceplugin-2.9.0.jar ├── myService-2.9.0.js ├── MyService.java ├── README.md └── index-2.9.0.html ├── 3.0.0 ├── backgroundserviceplugin-3.0.0.jar ├── myService-3.0.0.js ├── MyService.java ├── README.md └── index-3.0.0.html ├── 3.1.0 ├── backgroundserviceplugin-3.1.0.jar ├── myService-3.1.0.js ├── MyService.java ├── README.md └── index-3.1.0.html └── README.md /1.8.1/backgroundserviceplugin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/1.8.1/backgroundserviceplugin.jar -------------------------------------------------------------------------------- /2.0.0/backgroundserviceplugin-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.0.0/backgroundserviceplugin-2.0.0.jar -------------------------------------------------------------------------------- /2.2.0/backgroundserviceplugin-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.2.0/backgroundserviceplugin-2.2.0.jar -------------------------------------------------------------------------------- /2.3.0/backgroundserviceplugin-2.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.3.0/backgroundserviceplugin-2.3.0.jar -------------------------------------------------------------------------------- /2.4.0/backgroundserviceplugin-2.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.4.0/backgroundserviceplugin-2.4.0.jar -------------------------------------------------------------------------------- /2.5.0/backgroundserviceplugin-2.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.5.0/backgroundserviceplugin-2.5.0.jar -------------------------------------------------------------------------------- /2.6.0/backgroundserviceplugin-2.6.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.6.0/backgroundserviceplugin-2.6.0.jar -------------------------------------------------------------------------------- /2.7.0/backgroundserviceplugin-2.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.7.0/backgroundserviceplugin-2.7.0.jar -------------------------------------------------------------------------------- /2.8.0/backgroundserviceplugin-2.8.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.8.0/backgroundserviceplugin-2.8.0.jar -------------------------------------------------------------------------------- /2.8.1/backgroundserviceplugin-2.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.8.1/backgroundserviceplugin-2.8.1.jar -------------------------------------------------------------------------------- /2.9.0/backgroundserviceplugin-2.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/2.9.0/backgroundserviceplugin-2.9.0.jar -------------------------------------------------------------------------------- /3.0.0/backgroundserviceplugin-3.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/3.0.0/backgroundserviceplugin-3.0.0.jar -------------------------------------------------------------------------------- /3.1.0/backgroundserviceplugin-3.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Red-Folder/Cordova-Plugin-BackgroundService/HEAD/3.1.0/backgroundserviceplugin-3.1.0.jar -------------------------------------------------------------------------------- /2.0.0/myService-2.0.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.2.0/myService-2.2.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.3.0/myService-2.3.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.4.0/myService-2.4.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.5.0/myService-2.5.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.6.0/myService-2.6.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.7.0/myService-2.7.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.8.0/myService-2.8.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.8.1/myService-2.8.1.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /2.9.0/myService-2.9.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /3.0.0/myService-3.0.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /3.1.0/myService-3.1.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | cordova.define( 'cordova/plugin/myService', function(require, exports, module) { 18 | CreateBackgroundService('com.yournamespace.yourappname.MyService', require, exports, module); 19 | }); 20 | -------------------------------------------------------------------------------- /1.8.1/myService.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // /////////////////// 18 | (function(){ 19 | // /////////////////// 20 | 21 | // get local ref to global PhoneGap/Cordova/cordova object for exec function 22 | var cordovaRef = window.PhoneGap || window.Cordova || window.cordova; // old to new fallbacks 23 | 24 | 25 | cordovaRef.addConstructor(function() { 26 | cordovaRef.addPlugin("myService", new BackgroundService('com.yournamespace.yourappname.MyService')); 27 | }); 28 | 29 | // /////////////////// 30 | })(); 31 | // /////////////////// 32 | -------------------------------------------------------------------------------- /1.8.1/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.0.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.2.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.3.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.4.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.5.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.6.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.7.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.8.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.8.1/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /2.9.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /3.0.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /3.1.0/MyService.java: -------------------------------------------------------------------------------- 1 | package com.yournamespace.yourappname; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.util.Log; 10 | 11 | import com.red_folder.phonegap.plugin.backgroundservice.BackgroundService; 12 | 13 | public class MyService extends BackgroundService { 14 | 15 | private final static String TAG = MyService.class.getSimpleName(); 16 | 17 | private String mHelloTo = "World"; 18 | 19 | @Override 20 | protected JSONObject doWork() { 21 | JSONObject result = new JSONObject(); 22 | 23 | try { 24 | SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 25 | String now = df.format(new Date(System.currentTimeMillis())); 26 | 27 | String msg = "Hello " + this.mHelloTo + " - its currently " + now; 28 | result.put("Message", msg); 29 | 30 | Log.d(TAG, msg); 31 | } catch (JSONException e) { 32 | } 33 | 34 | return result; 35 | } 36 | 37 | @Override 38 | protected JSONObject getConfig() { 39 | JSONObject result = new JSONObject(); 40 | 41 | try { 42 | result.put("HelloTo", this.mHelloTo); 43 | } catch (JSONException e) { 44 | } 45 | 46 | return result; 47 | } 48 | 49 | @Override 50 | protected void setConfig(JSONObject config) { 51 | try { 52 | if (config.has("HelloTo")) 53 | this.mHelloTo = config.getString("HelloTo"); 54 | } catch (JSONException e) { 55 | } 56 | 57 | } 58 | 59 | @Override 60 | protected JSONObject initialiseLatestResult() { 61 | // TODO Auto-generated method stub 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onTimerEnabled() { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | protected void onTimerDisabled() { 73 | // TODO Auto-generated method stub 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /1.8.1/README.md: -------------------------------------------------------------------------------- 1 | # Depreciated Version - 21st August 2013 # 2 | 3 | Over time I will no longer maintain older versions. The code will still be available in the source, but may not compile or build without work. 4 | 5 | 6 | 7 | 8 | 9 | # Background Service Plugin for Phonegap # 10 | 11 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 12 | 13 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 14 | 15 | ## Adding the plugin to your project ## 16 | 17 | Copy the files to the following locations: 18 | 19 | * libs\backgroundserviceplugin.jar 20 | * src\com\yournamespace\yourappname\MyService.java 21 | * assets\www\backgroundService.js 22 | * assets\www\myService.js 23 | * assets\www\index.html 24 | 25 | Add the following to res\xml\plugins.xml 26 | 27 | ``` 28 | 29 | ``` 30 | 31 | Add the following to AndroidManifest.xml 32 | 33 | ``` 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | ``` 49 | ## Change Log ## 50 | 51 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 52 | 53 | 54 | ## Further Information ## 55 | 56 | Further information on the plugin can be found at: 57 | 58 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 59 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 60 | 61 | The below is a tutorial to create your own Twitter service: 62 | 63 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 64 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 65 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 66 | 67 | Please let me know your thoughts and comments. 68 | 69 | ## Licence ## 70 | 71 | The MIT License 72 | 73 | Copyright (c) 2012 Red Folder Consultancy Ltd 74 | 75 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 76 | 77 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 78 | 79 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 80 | 81 | 82 | -------------------------------------------------------------------------------- /2.0.0/README.md: -------------------------------------------------------------------------------- 1 | # Depreciated Version - 21st August 2013 # 2 | 3 | Over time I will no longer maintain older versions. The code will still be available in the source, but may not compile or build without work. 4 | 5 | 6 | 7 | 8 | 9 | # Background Service Plugin for Phonegap # 10 | 11 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 12 | 13 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 14 | 15 | ## Adding the plugin to your project ## 16 | 17 | Copy the files to the following locations: 18 | 19 | * libs\backgroundserviceplugin-2.0.0.jar 20 | * src\com\yournamespace\yourappname\MyService.java 21 | * assets\www\backgroundService-2.0.0.js 22 | * assets\www\myService-2.0.0.js 23 | * assets\www\index-2.0.0.html 24 | 25 | Add the following to res\xml\config.xml 26 | 27 | ``` 28 | 29 | ``` 30 | 31 | Add the following to AndroidManifest.xml 32 | 33 | ``` 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | ``` 49 | ## Change Log ## 50 | 51 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 52 | 53 | ## Further Information ## 54 | 55 | Further information on the plugin can be found at: 56 | 57 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 58 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 59 | 60 | The below is a tutorial to create your own Twitter service: 61 | 62 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 63 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 64 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 65 | 66 | Please let me know your thoughts and comments. 67 | 68 | ## Licence ## 69 | 70 | The MIT License 71 | 72 | Copyright (c) 2012 Red Folder Consultancy Ltd 73 | 74 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 75 | 76 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 77 | 78 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 79 | 80 | 81 | -------------------------------------------------------------------------------- /2.2.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.2.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.2.0.js 14 | * assets\www\myService-2.2.0.js 15 | * assets\www\index-2.2.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2012 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.3.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.3.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.3.0.js 14 | * assets\www\myService-2.3.0.js 15 | * assets\www\index-2.3.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2012 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.4.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.4.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.4.0.js 14 | * assets\www\myService-2.4.0.js 15 | * assets\www\index-2.4.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2012 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.5.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.5.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.5.0.js 14 | * assets\www\myService-2.5.0.js 15 | * assets\www\index-2.5.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2013 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.6.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.6.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.6.0.js 14 | * assets\www\myService-2.6.0.js 15 | * assets\www\index-2.6.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2013 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.7.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.7.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.7.0.js 14 | * assets\www\myService-2.7.0.js 15 | * assets\www\index-2.7.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2013 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.8.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.8.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.8.0.js 14 | * assets\www\myService-2.8.0.js 15 | * assets\www\index-2.8.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2013 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.8.1/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.8.1.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.8.1.js 14 | * assets\www\myService-2.8.1.js 15 | * assets\www\index-2.8.1.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2013 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /2.9.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-2.9.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-2.9.0.js 14 | * assets\www\myService-2.9.0.js 15 | * assets\www\index-2.9.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | Add the following to AndroidManifest.xml 24 | 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | ## Change Log ## 42 | 43 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 44 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 45 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 46 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 47 | * 12th May 2013 - Updated to handle service being restarted by OS 48 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 49 | 50 | ## Further Information ## 51 | 52 | Further information on the plugin can be found at: 53 | 54 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 55 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 56 | 57 | The below is a tutorial to create your own Twitter service: 58 | 59 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 60 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 62 | 63 | Please let me know your thoughts and comments. 64 | 65 | ## Spread the love ## 66 | 67 | If you find the Background Service Plugin useful then spread the love. 68 | 69 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 70 | 71 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 72 | 73 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 74 | 75 | ## Licence ## 76 | 77 | The MIT License 78 | 79 | Copyright (c) 2013 Red Folder Consultancy Ltd 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | 87 | 88 | -------------------------------------------------------------------------------- /3.1.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-3.1.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-3.1.0.js 14 | * assets\www\myService-3.1.0.js 15 | * assets\www\index-3.1.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | 22 | 23 | ``` 24 | 25 | Add the following to AndroidManifest.xml 26 | 27 | ``` 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ``` 43 | ## Change Log ## 44 | 45 | * 9th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 46 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 47 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 48 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 49 | * 12th May 2013 - Updated to handle service being restarted by OS 50 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 51 | 52 | ## Further Information ## 53 | 54 | Further information on the plugin can be found at: 55 | 56 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 57 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 58 | 59 | The below is a tutorial to create your own Twitter service: 60 | 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 62 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 63 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 64 | 65 | Please let me know your thoughts and comments. 66 | 67 | ## Spread the love ## 68 | 69 | If you find the Background Service Plugin useful then spread the love. 70 | 71 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 72 | 73 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 74 | 75 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 76 | 77 | ## Licence ## 78 | 79 | The MIT License 80 | 81 | Copyright (c) 2013 Red Folder Consultancy Ltd 82 | 83 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 84 | 85 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 86 | 87 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 88 | 89 | 90 | -------------------------------------------------------------------------------- /3.0.0/README.md: -------------------------------------------------------------------------------- 1 | # Background Service Plugin for Phonegap # 2 | 3 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 4 | 5 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 6 | 7 | ## Adding the plugin to your project ## 8 | 9 | Copy the files to the following locations: 10 | 11 | * libs\backgroundserviceplugin-3.0.0.jar 12 | * src\com\yournamespace\yourappname\MyService.java 13 | * assets\www\backgroundService-3.0.0.js 14 | * assets\www\myService-3.0.0.js 15 | * assets\www\index-3.0.0.html 16 | 17 | Add the following to res\xml\config.xml 18 | 19 | ``` 20 | 21 | 22 | 23 | ``` 24 | 25 | Add the following to AndroidManifest.xml 26 | 27 | ``` 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ``` 43 | ## Change Log ## 44 | 45 | * 13th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 46 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 47 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 48 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 49 | * 12th May 2013 - Updated to handle service being restarted by OS 50 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 51 | 52 | ## Further Information ## 53 | 54 | Further information on the plugin can be found at: 55 | 56 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 57 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 58 | 59 | The below is a tutorial to create your own Twitter service: 60 | 61 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 62 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 63 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 64 | 65 | Please let me know your thoughts and comments. 66 | 67 | ## Spread the love ## 68 | 69 | If you find the Background Service Plugin useful then spread the love. 70 | 71 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 72 | 73 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 74 | 75 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 76 | 77 | ## Licence ## 78 | 79 | The MIT License 80 | 81 | Copyright (c) 2013 Red Folder Consultancy Ltd 82 | 83 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 84 | 85 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 86 | 87 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 88 | 89 | 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IMPORTANT NOTE 2 | This repository is no longer active. 3 | 4 | The plugin has been converted to support the Plugman format plugins - for this I have created a new repository. This is in line with Cordova project direction. I will no longer support this repository. Any issues should be logged against the new respoistories. 5 | 6 | * Core logic is now Plugman compatible and found here -> https://github.com/Red-Folder/bgs-core 7 | * A sample plugin is also available in Plugman format and available here -> https://github.com/Red-Folder/bgs-sample 8 | * Both plugins are also available from http://plugins.cordova.io/ 9 | * Fully re-documented which can be found here -> https://github.com/Red-Folder/bgs-core/wiki 10 | * Issues should now me raised here -> https://github.com/Red-Folder/bgs-core/issues 11 | 12 | In future all updates to the plugin will be tweeted via @FolderRed 13 | 14 | 15 | 16 | 17 | 18 | # Background Service Plugin for Phonegap # 19 | 20 | A plugin (and framework code) that allows the development and operation of an Android Background Service. 21 | 22 | The example MyService Background Service will write a Hello message to the LogCat every minute. The MyService is designed as sample code. 23 | 24 | ## Cordova Versions ## 25 | 26 | Folders used for different Cordova versions: 27 | 28 | * /2.2.0 - For use with Cordova 2.2.0 29 | * /2.3.0 - For use with Cordova 2.3.0 30 | * /2.4.0 - For use with Cordova 2.4.0 31 | * /2.5.0 - For use with Cordova 2.5.0 32 | * /2.6.0 - For use with Cordova 2.6.0 33 | * /2.7.0 - For use with Cordova 2.7.0 34 | * /2.8.0 - For use with Cordova 2.8.0 35 | * /2.8.1 - For use with Cordova 2.8.1 36 | * /2.9.0 - For use with Cordova 2.9.0 37 | * /3.0.0 - For use with Cordova 3.0.0 38 | * /3.1.0 - For use with Cordova 3.1.0 39 | 40 | ## Depreciated Versions ## 41 | 42 | Over time I will no longer maintain older versions. These will be listed here. The code will still be available in the source, but may not compile or build without work. 43 | 44 | * /1.8.1 - For use with Cordova 1.8.1 - Depreciated 21st August 2013 45 | * /2.0.0 - For use with Cordova 2.0.0 - Depreciated 21st August 2013 46 | 47 | 48 | ## Change Log ## 49 | 50 | * 9th November 2013 - Added ability to listen for doWork() updates using registerForUpdates/ deregisterForUpdates. See individual version README for support info (rolling out version by version. For more info see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/17 51 | * 20th September 2013 - Added runOnce support (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/14) 52 | * 4th September 2013 - Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7) 53 | * 27th August 2013 - Added TimerMilliseconds to returned JSONObject (see Issue 5) 54 | * 12th May 2013 - Updated to handle service being restarted by OS (version 2.2+) 55 | * 14th November 2012 - Fix for service not stopping if the app has been closed then re-opened 56 | 57 | ## Further Information ## 58 | 59 | Further information on the plugin can be found at: 60 | 61 | * http://red-folder.blogspot.co.uk/2012/09/phonegap-android-background-service.html 62 | * http://red-folder.blogspot.com/2012/09/phonegap-android-background-service_11.html 63 | 64 | The below is a tutorial to create your own Twitter service: 65 | 66 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-1.html 67 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-2.html 68 | * http://red-folder.blogspot.com/2012/09/phonegap-service-tutorial-part-3.html 69 | 70 | Please let me know your thoughts and comments. 71 | 72 | ## Source Code ## 73 | 74 | This repository uses jar files for the main logic. Due to the complexity of the code, I've found this is the easiest method to distribute it. 75 | 76 | Should you be interested in the underlying source, it is available in this repository -> https://github.com/Red-Folder/Cordova-Plugin-BackgroundService-Source 77 | 78 | ## Spread the love ## 79 | 80 | If you find the Background Service Plugin useful then spread the love. 81 | 82 | All the work I do on the Plugin is done in my spare time - time I would otherwise be spending taking my wife out for a nice meal or helping my lad find vinyl records (he's currently very much into The Smiths, Fleetwood Mac and Kate Bush). 83 | 84 | The Plugin is free and will always remain free. I will continue to develop, maintain and distribute the Plugin under the MIT License. 85 | 86 | https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E64TCFQ3NLHZ8 87 | 88 | ## Licence ## 89 | 90 | The MIT License 91 | 92 | Copyright (c) 2013 Red Folder Consultancy Ltd 93 | 94 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 95 | 96 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 97 | 98 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 99 | 100 | -------------------------------------------------------------------------------- /2.0.0/index-2.0.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService 22 | 23 | 24 | 25 | 26 | 27 | 166 | 167 | 168 | 169 | 170 |

MyService

171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 |
Service
Timer
Boot
Configuration
Hello To
Latest Result
213 | 214 | 215 | -------------------------------------------------------------------------------- /1.8.1/backgroundService.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Constructor 19 | */ 20 | function BackgroundService(serviceName) { 21 | var ServiceName = serviceName; 22 | 23 | this.getServiceName = function() { 24 | return ServiceName; 25 | }; 26 | }; 27 | 28 | /** 29 | * All methods attempt to return the following data in both the success and failure callbacks 30 | * Front end development should take into account any all or all of these values may be null 31 | * 32 | * Following returned in the JSONObject: 33 | * Boolean Success - was the call a success 34 | * int ErrorCode - Error code if an error occurred, else will be zero 35 | * String ErrorMessage - Text representation of the error code 36 | * Boolean ServiceRunning - True if the Service is running 37 | * Boolean TimerEnabled - True if the Timer is enabled 38 | * Boolean RegisteredForBootStart - True if the Service is registered for boot start 39 | * JSONObject Configuration - A JSONObject of the configuration of the service (contents dependant on the service) 40 | * JSONObject LastestResult - A JSONObject of the last result of the service (contents dependant on the service) 41 | */ 42 | 43 | /** 44 | * Starts the Service 45 | * 46 | * @param successCallback The callback which will be called if the method is successful 47 | * @param failureCallback The callback which will be called if the method encounters an error 48 | */ 49 | BackgroundService.prototype.startService = function(successCallback, failureCallback) { 50 | return cordova.exec( successCallback, 51 | failureCallback, 52 | 'BackgroundServicePlugin', 53 | 'startService', 54 | [this.getServiceName()]); 55 | }; 56 | 57 | /** 58 | * Stops the Service 59 | * 60 | * @param successCallback The callback which will be called if the method is successful 61 | * @param failureCallback The callback which will be called if the method encounters an error 62 | */ 63 | BackgroundService.prototype.stopService = function(successCallback, failureCallback) { 64 | return cordova.exec( successCallback, 65 | failureCallback, 66 | 'BackgroundServicePlugin', 67 | 'stopService', 68 | [this.getServiceName()]); 69 | }; 70 | 71 | /** 72 | * Enables the Service Timer 73 | * 74 | * @param milliseconds The milliseconds used for the timer 75 | * @param successCallback The callback which will be called if the method is successful 76 | * @param failureCallback The callback which will be called if the method encounters an error 77 | */ 78 | BackgroundService.prototype.enableTimer = function(milliseconds, successCallback, failureCallback) { 79 | return cordova.exec( successCallback, 80 | failureCallback, 81 | 'BackgroundServicePlugin', 82 | 'enableTimer', 83 | [this.getServiceName(), milliseconds]); 84 | }; 85 | 86 | /** 87 | * Disabled the Service Timer 88 | * 89 | * @param successCallback The callback which will be called if the method is successful 90 | * @param failureCallback The callback which will be called if the method encounters an error 91 | */ 92 | BackgroundService.prototype.disableTimer = function(successCallback, failureCallback) { 93 | return cordova.exec( successCallback, 94 | failureCallback, 95 | 'BackgroundServicePlugin', 96 | 'disableTimer', 97 | [this.getServiceName()]); 98 | }; 99 | 100 | /** 101 | * Sets the configuration for the service 102 | * 103 | * @oaran configuration JSONObject to be sent to the service 104 | * @param successCallback The callback which will be called if the method is successful 105 | * @param failureCallback The callback which will be called if the method encounters an error 106 | */ 107 | BackgroundService.prototype.setConfiguration = function(configuration, successCallback, failureCallback) { 108 | return cordova.exec( successCallback, 109 | failureCallback, 110 | 'BackgroundServicePlugin', 111 | 'setConfiguration', 112 | [this.getServiceName(), configuration]); 113 | }; 114 | 115 | /** 116 | * Registers the service for Boot Start 117 | * 118 | * @param successCallback The callback which will be called if the method is successful 119 | * @param failureCallback The callback which will be called if the method encounters an error 120 | */ 121 | BackgroundService.prototype.registerForBootStart = function(successCallback, failureCallback) { 122 | return cordova.exec( successCallback, 123 | failureCallback, 124 | 'BackgroundServicePlugin', 125 | 'registerForBootStart', 126 | [this.getServiceName()]); 127 | }; 128 | 129 | /** 130 | * Deregisters the service for Boot Start 131 | * 132 | * @param successCallback The callback which will be called if the method is successful 133 | * @param failureCallback The callback which will be called if the method encounters an error 134 | */ 135 | BackgroundService.prototype.deregisterForBootStart = function(successCallback, failureCallback) { 136 | return cordova.exec( successCallback, 137 | failureCallback, 138 | 'BackgroundServicePlugin', 139 | 'deregisterForBootStart', 140 | [this.getServiceName()]); 141 | }; 142 | 143 | /** 144 | * Get the current status of the service. 145 | * 146 | * @param successCallback The callback which will be called if the method is successful 147 | * @param failureCallback The callback which will be called if the method encounters an error 148 | */ 149 | BackgroundService.prototype.isRegisteredForBootStart = function(successCallback, failureCallback) { 150 | return cordova.exec( successCallback, 151 | failureCallback, 152 | 'BackgroundServicePlugin', 153 | 'isRegisteredForBootStart', 154 | [this.getServiceName()]); 155 | }; 156 | 157 | 158 | /** 159 | * Returns the status of the service 160 | * 161 | * @param successCallback The callback which will be called if the method is successful 162 | * @param failureCallback The callback which will be called if the method encounters an error 163 | */ 164 | BackgroundService.prototype.getStatus = function(successCallback, failureCallback) { 165 | return cordova.exec( successCallback, 166 | failureCallback, 167 | 'BackgroundServicePlugin', 168 | 'getStatus', 169 | [this.getServiceName()]); 170 | }; 171 | 172 | -------------------------------------------------------------------------------- /1.8.1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService 22 | 23 | 24 | 25 | 26 | 27 | 170 | 171 | 172 | 173 | 174 |

MyService

175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 |
Service
Timer
Boot
Configuration
Hello To
Latest Result
217 | 218 | 219 | -------------------------------------------------------------------------------- /2.0.0/backgroundService-2.0.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Constructor 19 | */ 20 | function CreateBackgroundService(serviceName, require, exports, module) { 21 | var exec = require("cordova/exec"); 22 | 23 | var BackgroundService = function (serviceName) { 24 | var ServiceName = serviceName 25 | this.getServiceName = function() { 26 | return ServiceName; 27 | }; 28 | }; 29 | 30 | var BackgroundServiceError = function (code, message) { 31 | this.code = code || null; 32 | this.message = message || null; 33 | }; 34 | 35 | /** 36 | * All methods attempt to return the following data in both the success and failure callbacks 37 | * Front end development should take into account any all or all of these values may be null 38 | * 39 | * Following returned in the JSONObject: 40 | * Boolean Success - was the call a success 41 | * int ErrorCode - Error code if an error occurred, else will be zero 42 | * String ErrorMessage - Text representation of the error code 43 | * Boolean ServiceRunning - True if the Service is running 44 | * Boolean TimerEnabled - True if the Timer is enabled 45 | * Boolean RegisteredForBootStart - True if the Service is registered for boot start 46 | * JSONObject Configuration - A JSONObject of the configuration of the service (contents dependant on the service) 47 | * JSONObject LastestResult - A JSONObject of the last result of the service (contents dependant on the service) 48 | */ 49 | 50 | /** 51 | * Starts the Service 52 | * 53 | * @param successCallback The callback which will be called if the method is successful 54 | * @param failureCallback The callback which will be called if the method encounters an error 55 | */ 56 | BackgroundService.prototype.startService = function(successCallback, failureCallback) { 57 | return exec( successCallback, 58 | failureCallback, 59 | 'BackgroundServicePlugin', 60 | 'startService', 61 | [this.getServiceName()]); 62 | }; 63 | 64 | /** 65 | * Stops the Service 66 | * 67 | * @param successCallback The callback which will be called if the method is successful 68 | * @param failureCallback The callback which will be called if the method encounters an error 69 | */ 70 | BackgroundService.prototype.stopService = function(successCallback, failureCallback) { 71 | return exec( successCallback, 72 | failureCallback, 73 | 'BackgroundServicePlugin', 74 | 'stopService', 75 | [this.getServiceName()]); 76 | }; 77 | 78 | /** 79 | * Enables the Service Timer 80 | * 81 | * @param milliseconds The milliseconds used for the timer 82 | * @param successCallback The callback which will be called if the method is successful 83 | * @param failureCallback The callback which will be called if the method encounters an error 84 | */ 85 | BackgroundService.prototype.enableTimer = function(milliseconds, successCallback, failureCallback) { 86 | return exec( successCallback, 87 | failureCallback, 88 | 'BackgroundServicePlugin', 89 | 'enableTimer', 90 | [this.getServiceName(), milliseconds]); 91 | }; 92 | 93 | /** 94 | * Disabled the Service Timer 95 | * 96 | * @param successCallback The callback which will be called if the method is successful 97 | * @param failureCallback The callback which will be called if the method encounters an error 98 | */ 99 | BackgroundService.prototype.disableTimer = function(successCallback, failureCallback) { 100 | return exec( successCallback, 101 | failureCallback, 102 | 'BackgroundServicePlugin', 103 | 'disableTimer', 104 | [this.getServiceName()]); 105 | }; 106 | 107 | /** 108 | * Sets the configuration for the service 109 | * 110 | * @oaran configuration JSONObject to be sent to the service 111 | * @param successCallback The callback which will be called if the method is successful 112 | * @param failureCallback The callback which will be called if the method encounters an error 113 | */ 114 | BackgroundService.prototype.setConfiguration = function(configuration, successCallback, failureCallback) { 115 | return exec( successCallback, 116 | failureCallback, 117 | 'BackgroundServicePlugin', 118 | 'setConfiguration', 119 | [this.getServiceName(), configuration]); 120 | }; 121 | 122 | /** 123 | * Registers the service for Boot Start 124 | * 125 | * @param successCallback The callback which will be called if the method is successful 126 | * @param failureCallback The callback which will be called if the method encounters an error 127 | */ 128 | BackgroundService.prototype.registerForBootStart = function(successCallback, failureCallback) { 129 | return exec( successCallback, 130 | failureCallback, 131 | 'BackgroundServicePlugin', 132 | 'registerForBootStart', 133 | [this.getServiceName()]); 134 | }; 135 | 136 | /** 137 | * Deregisters the service for Boot Start 138 | * 139 | * @param successCallback The callback which will be called if the method is successful 140 | * @param failureCallback The callback which will be called if the method encounters an error 141 | */ 142 | BackgroundService.prototype.deregisterForBootStart = function(successCallback, failureCallback) { 143 | return exec( successCallback, 144 | failureCallback, 145 | 'BackgroundServicePlugin', 146 | 'deregisterForBootStart', 147 | [this.getServiceName()]); 148 | }; 149 | 150 | /** 151 | * Get the current status of the service. 152 | * 153 | * @param successCallback The callback which will be called if the method is successful 154 | * @param failureCallback The callback which will be called if the method encounters an error 155 | */ 156 | BackgroundService.prototype.isRegisteredForBootStart = function(successCallback, failureCallback) { 157 | return exec( successCallback, 158 | failureCallback, 159 | 'BackgroundServicePlugin', 160 | 'isRegisteredForBootStart', 161 | [this.getServiceName()]); 162 | }; 163 | 164 | 165 | /** 166 | * Returns the status of the service 167 | * 168 | * @param successCallback The callback which will be called if the method is successful 169 | * @param failureCallback The callback which will be called if the method encounters an error 170 | */ 171 | BackgroundService.prototype.getStatus = function(successCallback, failureCallback) { 172 | return exec( successCallback, 173 | failureCallback, 174 | 'BackgroundServicePlugin', 175 | 'getStatus', 176 | [this.getServiceName()]); 177 | }; 178 | 179 | var backgroundService = new BackgroundService(serviceName); 180 | module.exports = backgroundService; 181 | }; 182 | -------------------------------------------------------------------------------- /2.2.0/index-2.2.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.2.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.3.0/index-2.3.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.3.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.3.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.4.0/index-2.4.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.4.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.4.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.5.0/index-2.5.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.5.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.5.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.6.0/index-2.6.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.6.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.6.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.7.0/index-2.7.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.7.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.7.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.8.0/index-2.8.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.8.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.8.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.8.1/index-2.8.1.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.8.1 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.8.1

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.9.0/index-2.9.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V2.9.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V2.9.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /3.0.0/index-3.0.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V3.0.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V3.0.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /3.1.0/index-3.1.0.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | MyService V3.1.0 22 | 23 | 24 | 25 | 26 | 27 | 187 | 188 | 189 | 190 | 191 |

MyService V3.1.0

192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Service
Timer
Boot
Listen
Configuration
Hello To
Latest Result
239 | 240 | 241 | -------------------------------------------------------------------------------- /2.2.0/backgroundService-2.2.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Red Folder Consultancy Ltd 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Constructor 19 | */ 20 | function CreateBackgroundService(serviceName, require, exports, module) { 21 | var exec = require("cordova/exec"); 22 | 23 | var BackgroundService = function (serviceName) { 24 | var ServiceName = serviceName 25 | this.getServiceName = function() { 26 | return ServiceName; 27 | }; 28 | }; 29 | 30 | var BackgroundServiceError = function (code, message) { 31 | this.code = code || null; 32 | this.message = message || null; 33 | }; 34 | 35 | /** 36 | * All methods attempt to return the following data in both the success and failure callbacks 37 | * Front end development should take into account any all or all of these values may be null 38 | * 39 | * Following returned in the JSONObject: 40 | * Boolean Success - was the call a success 41 | * int ErrorCode - Error code if an error occurred, else will be zero 42 | * String ErrorMessage - Text representation of the error code 43 | * Boolean ServiceRunning - True if the Service is running 44 | * Boolean TimerEnabled - True if the Timer is enabled 45 | * Boolean RegisteredForBootStart - True if the Service is registered for boot start 46 | * JSONObject Configuration - A JSONObject of the configuration of the service (contents dependant on the service) 47 | * JSONObject LastestResult - A JSONObject of the last result of the service (contents dependant on the service) 48 | * int TimerMilliseconds - Milliseconds used by the background service if Timer enabled 49 | * Boolean RegisteredForUpdates - True if the Service is registered to send updates to the front-end 50 | */ 51 | 52 | /** 53 | * Starts the Service 54 | * 55 | * @param successCallback The callback which will be called if the method is successful 56 | * @param failureCallback The callback which will be called if the method encounters an error 57 | */ 58 | BackgroundService.prototype.startService = function(successCallback, failureCallback) { 59 | return exec( successCallback, 60 | failureCallback, 61 | 'BackgroundServicePlugin', 62 | 'startService', 63 | [this.getServiceName()]); 64 | }; 65 | 66 | /** 67 | * Stops the Service 68 | * 69 | * @param successCallback The callback which will be called if the method is successful 70 | * @param failureCallback The callback which will be called if the method encounters an error 71 | */ 72 | BackgroundService.prototype.stopService = function(successCallback, failureCallback) { 73 | return exec( successCallback, 74 | failureCallback, 75 | 'BackgroundServicePlugin', 76 | 'stopService', 77 | [this.getServiceName()]); 78 | }; 79 | 80 | /** 81 | * Enables the Service Timer 82 | * 83 | * @param milliseconds The milliseconds used for the timer 84 | * @param successCallback The callback which will be called if the method is successful 85 | * @param failureCallback The callback which will be called if the method encounters an error 86 | */ 87 | BackgroundService.prototype.enableTimer = function(milliseconds, successCallback, failureCallback) { 88 | return exec( successCallback, 89 | failureCallback, 90 | 'BackgroundServicePlugin', 91 | 'enableTimer', 92 | [this.getServiceName(), milliseconds]); 93 | }; 94 | 95 | /** 96 | * Disabled the Service Timer 97 | * 98 | * @param successCallback The callback which will be called if the method is successful 99 | * @param failureCallback The callback which will be called if the method encounters an error 100 | */ 101 | BackgroundService.prototype.disableTimer = function(successCallback, failureCallback) { 102 | return exec( successCallback, 103 | failureCallback, 104 | 'BackgroundServicePlugin', 105 | 'disableTimer', 106 | [this.getServiceName()]); 107 | }; 108 | 109 | /** 110 | * Sets the configuration for the service 111 | * 112 | * @param configuration JSONObject to be sent to the service 113 | * @param successCallback The callback which will be called if the method is successful 114 | * @param failureCallback The callback which will be called if the method encounters an error 115 | */ 116 | BackgroundService.prototype.setConfiguration = function(configuration, successCallback, failureCallback) { 117 | return exec( successCallback, 118 | failureCallback, 119 | 'BackgroundServicePlugin', 120 | 'setConfiguration', 121 | [this.getServiceName(), configuration]); 122 | }; 123 | 124 | /** 125 | * Registers the service for Boot Start 126 | * 127 | * @param successCallback The callback which will be called if the method is successful 128 | * @param failureCallback The callback which will be called if the method encounters an error 129 | */ 130 | BackgroundService.prototype.registerForBootStart = function(successCallback, failureCallback) { 131 | return exec( successCallback, 132 | failureCallback, 133 | 'BackgroundServicePlugin', 134 | 'registerForBootStart', 135 | [this.getServiceName()]); 136 | }; 137 | 138 | /** 139 | * Deregisters the service for Boot Start 140 | * 141 | * @param successCallback The callback which will be called if the method is successful 142 | * @param failureCallback The callback which will be called if the method encounters an error 143 | */ 144 | BackgroundService.prototype.deregisterForBootStart = function(successCallback, failureCallback) { 145 | return exec( successCallback, 146 | failureCallback, 147 | 'BackgroundServicePlugin', 148 | 'deregisterForBootStart', 149 | [this.getServiceName()]); 150 | }; 151 | 152 | /** 153 | * Get the current status of the service. 154 | * 155 | * @param successCallback The callback which will be called if the method is successful 156 | * @param failureCallback The callback which will be called if the method encounters an error 157 | */ 158 | BackgroundService.prototype.isRegisteredForBootStart = function(successCallback, failureCallback) { 159 | return exec( successCallback, 160 | failureCallback, 161 | 'BackgroundServicePlugin', 162 | 'isRegisteredForBootStart', 163 | [this.getServiceName()]); 164 | }; 165 | 166 | 167 | /** 168 | * Returns the status of the service 169 | * 170 | * @param successCallback The callback which will be called if the method is successful 171 | * @param failureCallback The callback which will be called if the method encounters an error 172 | */ 173 | BackgroundService.prototype.getStatus = function(successCallback, failureCallback) { 174 | return exec( successCallback, 175 | failureCallback, 176 | 'BackgroundServicePlugin', 177 | 'getStatus', 178 | [this.getServiceName()]); 179 | }; 180 | 181 | /** 182 | * Returns the doWork once 183 | * 184 | * @param successCallback The callback which will be called if the method is successful 185 | * @param failureCallback The callback which will be called if the method encounters an error 186 | */ 187 | BackgroundService.prototype.runOnce = function(successCallback, failureCallback) { 188 | return exec( successCallback, 189 | failureCallback, 190 | 'BackgroundServicePlugin', 191 | 'runOnce', 192 | [this.getServiceName()]); 193 | }; 194 | 195 | /** 196 | * Registers for doWork() updates 197 | * 198 | * @param successCallback The callback which will be called if the method is successful 199 | * @param failureCallback The callback which will be called if the method encounters an error 200 | */ 201 | BackgroundService.prototype.registerForUpdates = function(successCallback, failureCallback) { 202 | return exec( successCallback, 203 | failureCallback, 204 | 'BackgroundServicePlugin', 205 | 'registerForUpdates', 206 | [this.getServiceName()]); 207 | }; 208 | 209 | /** 210 | * Deregisters for doWork() updates 211 | * 212 | * @param successCallback The callback which will be called if the method is successful 213 | * @param failureCallback The callback which will be called if the method encounters an error 214 | */ 215 | BackgroundService.prototype.deregisterForUpdates = function(successCallback, failureCallback) { 216 | return exec( successCallback, 217 | failureCallback, 218 | 'BackgroundServicePlugin', 219 | 'deregisterForUpdates', 220 | [this.getServiceName()]); 221 | }; 222 | 223 | var backgroundService = new BackgroundService(serviceName); 224 | module.exports = backgroundService; 225 | }; 226 | --------------------------------------------------------------------------------