Convert FileUtils to plugin architecture.

This commit is contained in:
Bryce Curtis
2010-09-17 15:41:48 -05:00
parent b95ad44c18
commit 00dc18a488
2 changed files with 238 additions and 102 deletions
+1 -3
View File
@@ -82,7 +82,6 @@ public class DroidGap extends Activity {
protected Boolean loadInWebView = false;
private LinearLayout root;
private FileUtils fs;
private BrowserKey mKey;
public CallbackServer callbackServer;
private PluginManager pluginManager;
@@ -266,13 +265,11 @@ public class DroidGap extends Activity {
private void bindBrowser(WebView appView) {
this.callbackServer = new CallbackServer();
this.pluginManager = new PluginManager(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.fs, "FileUtil");
appView.addJavascriptInterface(this.mKey, "BackButton");
appView.addJavascriptInterface(this.callbackServer, "CallbackServer");
@@ -296,6 +293,7 @@ public class DroidGap extends Activity {
this.addService("Camera", "com.phonegap.CameraLauncher");
this.addService("Contacts", "com.phonegap.ContactManager");
this.addService("Crypto", "com.phonegap.CryptoHandler");
this.addService("File", "com.phonegap.FileUtils");
this.addService("Location", "com.phonegap.GeoBroker");
this.addService("Network Status", "com.phonegap.NetworkManager");
this.addService("Storage", "com.phonegap.Storage");