From a21080fb76ca9ef9a60d592b7bf1a5ecdca88244 Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Fri, 10 Sep 2010 11:31:22 -0500 Subject: [PATCH] Add services supported and their class names. --- framework/src/com/phonegap/DroidGap.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index 52968e72..371d4d23 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -252,6 +252,16 @@ public class DroidGap extends Activity { } } + /** + * Add a class that implements a service. + * + * @param serviceType + * @param className + */ + public void addService(String serviceType, String className) { + this.pluginManager.addService(serviceType, className); + } + /** * Bind PhoneGap objects to JavaScript. * @@ -284,6 +294,17 @@ public class DroidGap extends Activity { this.pluginManager.addPlugin("com.phonegap.GeoBroker"); } + + this.addService("Accelerometer", "com.phonegap.AccelListener"); + this.addService("Compass", "com.phonegap.CompassListener"); + this.addService("Media", "com.phonegap.AudioHandler"); + this.addService("Camera", "com.phonegap.CameraLauncher"); + this.addService("Contacts", "com.phonegap.ContactManager"); + this.addService("Crypto", "com.phonegap.CryptoHandler"); + this.addService("Location", "com.phonegap.GeoBroker"); + this.addService("Network Status", "com.phonegap.NetworkManager"); + this.addService("Storage", "com.phonegap.Storage"); + this.addService("Temperature", "com.phonegap.TempListener"); } /**