Change Device JS object to include only platform, uuid, version, and phonegap properties as defined in API, and modify Device Java class to implement plugin interface.

This commit is contained in:
Bryce Curtis
2010-09-15 14:27:46 -05:00
parent c050e00b8f
commit 705b8f6874
4 changed files with 231 additions and 103 deletions
+1 -3
View File
@@ -83,7 +83,6 @@ public class DroidGap extends Activity {
protected Boolean loadInWebView = false;
private LinearLayout root;
private Device gap;
private FileUtils fs;
private BrowserKey mKey;
public CallbackServer callbackServer;
@@ -270,13 +269,11 @@ public class DroidGap extends Activity {
private void bindBrowser(WebView appView) {
this.callbackServer = new CallbackServer();
this.pluginManager = new PluginManager(appView, this);
this.gap = new Device(appView, this);
this.fs = new FileUtils(appView, this);
this.mKey = new BrowserKey(appView, this);
// This creates the new javascript interfaces for PhoneGap
appView.addJavascriptInterface(this.pluginManager, "PluginManager");
appView.addJavascriptInterface(this.gap, "DroidGap");
appView.addJavascriptInterface(this.fs, "FileUtil");
appView.addJavascriptInterface(this.mKey, "BackButton");
@@ -295,6 +292,7 @@ public class DroidGap extends Activity {
}
this.addService("Device", "com.phonegap.Device");
this.addService("Accelerometer", "com.phonegap.AccelListener");
this.addService("Compass", "com.phonegap.CompassListener");
this.addService("Media", "com.phonegap.AudioHandler");