incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject [8/15] Rename to Cordova
Date Fri, 03 Feb 2012 15:43:10 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java b/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java
deleted file mode 100755
index e34dc27..0000000
--- a/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap;
-import com.phonegap.api.LOG;
-
-import android.content.Context;
-import android.view.View.MeasureSpec;
-import android.widget.LinearLayout;
-
-/**
- * This class is used to detect when the soft keyboard is shown and hidden in the web view.
- */
-public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
-
-    private static final String TAG = "SoftKeyboardDetect";
-    
-    private int oldHeight = 0;  // Need to save the old height as not to send redundant events
-    private int oldWidth = 0; // Need to save old width for orientation change          
-    private int screenWidth = 0;
-    private int screenHeight = 0;
-    private DroidGap app = null;
-                
-    public LinearLayoutSoftKeyboardDetect(Context context, int width, int height) {
-        super(context);     
-        screenWidth = width;
-        screenHeight = height;
-        app = (DroidGap) context;
-    }
-
-    @Override
-    /**
-     * Start listening to new measurement events.  Fire events when the height 
-     * gets smaller fire a show keyboard event and when height gets bigger fire 
-     * a hide keyboard event.
-     * 
-     * Note: We are using app.postMessage so that this is more compatible with the API
-     * 
-     * @param widthMeasureSpec
-     * @param heightMeasureSpec
-     */
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        super.onMeasure(widthMeasureSpec, heightMeasureSpec);       
-        
-        LOG.v(TAG, "We are in our onMeasure method");
-
-        // Get the current height of the visible part of the screen.
-        // This height will not included the status bar.\
-        int width, height;
-
-        height = MeasureSpec.getSize(heightMeasureSpec);
-        width = MeasureSpec.getSize(widthMeasureSpec);
-        LOG.v(TAG, "Old Height = %d", oldHeight);
-        LOG.v(TAG, "Height = %d", height);             
-        LOG.v(TAG, "Old Width = %d", oldWidth);
-        LOG.v(TAG, "Width = %d", width);
-
-        // If the oldHeight = 0 then this is the first measure event as the app starts up.
-        // If oldHeight == height then we got a measurement change that doesn't affect us.
-        if (oldHeight == 0 || oldHeight == height) {
-            LOG.d(TAG, "Ignore this event");
-        }
-        // Account for orientation change and ignore this event/Fire orientation change
-        else if(screenHeight == width)
-        {
-            int tmp_var = screenHeight;
-            screenHeight = screenWidth;
-            screenWidth = tmp_var;
-            LOG.v(TAG, "Orientation Change");
-        }
-        // If the height as gotten bigger then we will assume the soft keyboard has 
-        // gone away.
-        else if (height > oldHeight) {
-            if(app != null)
-                app.sendJavascript("PhoneGap.fireDocumentEvent('hidekeyboard');");
-        } 
-        // If the height as gotten smaller then we will assume the soft keyboard has 
-        // been displayed.
-        else if (height < oldHeight) {
-            if(app != null)
-                app.sendJavascript("PhoneGap.fireDocumentEvent('showkeyboard');");
-        }
-
-        // Update the old height for the next event
-        oldHeight = height;
-        oldWidth = width;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/NetworkListener.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/NetworkListener.java b/framework/src/com/phonegap/NetworkListener.java
deleted file mode 100755
index be83076..0000000
--- a/framework/src/com/phonegap/NetworkListener.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap;
-
-import com.phonegap.api.PhonegapActivity;
-
-import android.content.Context;
-import android.location.Location;
-import android.location.LocationManager;
-import android.location.LocationListener;
-import android.os.Bundle;
-
-public class NetworkListener implements LocationListener {
-	
-	private PhonegapActivity mCtx;				// PhonegapActivity object
-	
-	private LocationManager mLocMan;			// Location manager object
-	private GeoListener owner;					// Geolistener object (parent)
-	private boolean hasData = false;			// Flag indicates if location data is available in cLoc
-	private Location cLoc;						// Last recieved location
-	private boolean running = false;			// Flag indicates if listener is running
-
-	/**
-	 * Constructor.  
-	 * Automatically starts listening.
-	 * 
-	 * @param ctx
-	 * @param interval
-	 * @param m
-	 */
-	public NetworkListener(PhonegapActivity ctx, int interval, GeoListener m) {
-		this.owner = m;
-		this.mCtx = ctx;
-		this.mLocMan = (LocationManager) this.mCtx.getSystemService(Context.LOCATION_SERVICE);
-		this.running = false;
-		this.start(interval);
-	}
-	
-	/**
-	 * Get last location.
-	 * 
-	 * @return 				Location object
-	 */
-	public Location getLocation() {
-		this.cLoc = this.mLocMan.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
-		if (this.cLoc != null) {
-			this.hasData = true;
-		}
-		return this.cLoc;
-	}
-
-	/**
-	 * Called when the provider is disabled by the user.
-	 * 
-	 * @param provider
-	 */
-	public void onProviderDisabled(String provider) {
-		System.out.println("NetworkListener: The provider " + provider + " is disabled");
-	}
-
-	/**
-	 * Called when the provider is enabled by the user.
-	 * 
-	 * @param provider
-	 */
-	public void onProviderEnabled(String provider) {
-		System.out.println("NetworkListener: The provider "+ provider + " is enabled");
-	}
-
-	/**
-	 * Called when the provider status changes. This method is called when a 
-	 * provider is unable to fetch a location or if the provider has recently 
-	 * become available after a period of unavailability.
-	 * 
-	 * @param provider
-	 * @param status
-	 * @param extras
-	 */
-	public void onStatusChanged(String provider, int status, Bundle extras) {
-		System.out.println("NetworkListener: The status of the provider " + provider + " has changed");
-		if (status == 0) {
-			System.out.println("NetworkListener: " + provider + " is OUT OF SERVICE");
-		}
-		else if (status == 1) {
-			System.out.println("NetworkListener: " + provider + " is TEMPORARILY_UNAVAILABLE");
-		}
-		else {
-			System.out.println("NetworkListener: " + provider + " is Available");
-		}
-	}
-
-	/**
-	 * Called when the location has changed.
-	 * 
-	 * @param location
-	 */
-	public void onLocationChanged(Location location) {
-		System.out.println("NetworkListener: The location has been updated!");
-		this.hasData = true;
-		this.cLoc = location;
-		
-		// The GPS is the primary form of Geolocation in PhoneGap.  
-		// Only fire the success variables if the GPS is down for some reason.
-		if (!this.owner.mGps.hasLocation()) {
-			this.owner.success(location);
-		}
-	}
-	
-	/**
-	 * Start requesting location updates.
-	 * 
-	 * @param interval
-	 */
-	public void start(int interval)	{
-		if (!this.running) {
-			this.running = true;
-			this.mLocMan.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, interval, 0, this);
-			this.getLocation();
-			
-			// If Network provider has data but GPS provider doesn't, then send ours
-			if (this.hasData && !this.owner.mGps.hasLocation()) {
-				this.owner.success(this.cLoc);
-			}
-		}
-	}
-	
-	/**
-	 * Stop receiving location updates.
-	 */
-	public void stop() {
-		if (this.running) {
-			this.mLocMan.removeUpdates(this);
-		}
-		this.running = false;
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/NetworkManager.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/NetworkManager.java b/framework/src/com/phonegap/NetworkManager.java
deleted file mode 100755
index 2be55d1..0000000
--- a/framework/src/com/phonegap/NetworkManager.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap;
-
-import org.json.JSONArray;
-
-import com.phonegap.api.PhonegapActivity;
-import com.phonegap.api.Plugin;
-import com.phonegap.api.PluginResult;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
-import android.util.Log;
-
-public class NetworkManager extends Plugin {
-    
-    public static int NOT_REACHABLE = 0;
-    public static int REACHABLE_VIA_CARRIER_DATA_NETWORK = 1;
-    public static int REACHABLE_VIA_WIFI_NETWORK = 2;
-
-    public static final String WIFI = "wifi";
-    public static final String WIMAX = "wimax";
-    // mobile
-    public static final String MOBILE = "mobile";
-    // 2G network types
-    public static final String GSM = "gsm";
-    public static final String GPRS = "gprs";
-    public static final String EDGE = "edge";
-    // 3G network types
-    public static final String CDMA = "cdma";
-    public static final String UMTS = "umts";
-    public static final String HSPA = "hspa";
-    public static final String HSUPA = "hsupa";
-    public static final String HSDPA = "hsdpa";
-    public static final String ONEXRTT = "1xrtt";
-    public static final String EHRPD = "ehrpd";
-    // 4G network types
-    public static final String LTE = "lte";
-    public static final String UMB = "umb";
-    public static final String HSPA_PLUS = "hspa+";
-    // return types
-    public static final String TYPE_UNKNOWN = "unknown";
-    public static final String TYPE_ETHERNET = "ethernet";
-    public static final String TYPE_WIFI = "wifi";
-    public static final String TYPE_2G = "2g";
-    public static final String TYPE_3G = "3g";
-    public static final String TYPE_4G = "4g";
-    public static final String TYPE_NONE = "none";
-    
-    private static final String LOG_TAG = "NetworkManager";
-
-    private String connectionCallbackId;
-
-    ConnectivityManager sockMan;
-    BroadcastReceiver receiver;
-    
-    /**
-     * Constructor.
-     */
-    public NetworkManager()    {
-        this.receiver = null;
-    }
-
-    /**
-     * Sets the context of the Command. This can then be used to do things like
-     * get file paths associated with the Activity.
-     * 
-     * @param ctx The context of the main Activity.
-     */
-    public void setContext(PhonegapActivity ctx) {
-        super.setContext(ctx);
-        this.sockMan = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);        
-        this.connectionCallbackId = null;
-        
-        // We need to listen to connectivity events to update navigator.connection
-        IntentFilter intentFilter = new IntentFilter() ;
-        intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
-        if (this.receiver == null) {
-            this.receiver = new BroadcastReceiver() {
-                @Override
-                public void onReceive(Context context, Intent intent) {                
-                    updateConnectionInfo((NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO));                
-                }
-            };
-            ctx.registerReceiver(this.receiver, intentFilter);
-        }
-
-    }
-    
-    /**
-     * Executes the request and returns PluginResult.
-     * 
-     * @param action         The action to execute.
-     * @param args             JSONArry of arguments for the plugin.
-     * @param callbackId    The callback id used when calling back into JavaScript.
-     * @return                 A PluginResult object with a status and message.
-     */
-    public PluginResult execute(String action, JSONArray args, String callbackId) {
-        PluginResult.Status status = PluginResult.Status.INVALID_ACTION;
-        String result = "Unsupported Operation: " + action;    
-        
-        if (action.equals("getConnectionInfo")) {
-            this.connectionCallbackId = callbackId;
-            NetworkInfo info = sockMan.getActiveNetworkInfo();
-            PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, this.getConnectionInfo(info));
-            pluginResult.setKeepCallback(true);
-            return pluginResult;
-        }
-        
-        return new PluginResult(status, result);
-    }
-
-    /**
-     * Identifies if action to be executed returns a value and should be run synchronously.
-     * 
-     * @param action    The action to execute
-     * @return            T=returns value
-     */
-    public boolean isSynch(String action) {
-        // All methods take a while, so always use async
-        return false;
-    }
-    
-    /**
-     * Stop network receiver.
-     */
-    public void onDestroy() {
-        if (this.receiver != null) {
-            try {
-                this.ctx.unregisterReceiver(this.receiver);
-            } catch (Exception e) {
-                Log.e(LOG_TAG, "Error unregistering network receiver: " + e.getMessage(), e);
-            }
-        }
-    }
-
-    //--------------------------------------------------------------------------
-    // LOCAL METHODS
-    //--------------------------------------------------------------------------
-
-
-    /**
-     * Updates the JavaScript side whenever the connection changes
-     * 
-     * @param info the current active network info
-     * @return
-     */
-    private void updateConnectionInfo(NetworkInfo info) {     
-        // send update to javascript "navigator.network.connection"
-        sendUpdate(this.getConnectionInfo(info));
-    }
-
-    /** 
-     * Get the latest network connection information
-     * 
-     * @param info the current active network info
-     * @return a JSONObject that represents the network info
-     */
-    private String getConnectionInfo(NetworkInfo info) {
-        String type = TYPE_NONE;
-        if (info != null) {
-            // If we are not connected to any network set type to none
-            if (!info.isConnected()) {
-                type = TYPE_NONE;
-            }            
-            else {
-                type = getType(info);
-            }
-        }
-        return type;
-    }
-    
-    /**
-     * Create a new plugin result and send it back to JavaScript
-     * 
-     * @param connection the network info to set as navigator.connection
-     */
-    private void sendUpdate(String type) {
-        PluginResult result = new PluginResult(PluginResult.Status.OK, type);
-        result.setKeepCallback(true);
-        this.success(result, this.connectionCallbackId);
-        
-        // Send to all plugins
-        this.ctx.postMessage("networkconnection", type);
-    }
-    
-    /**
-     * Determine the type of connection
-     * 
-     * @param info the network info so we can determine connection type.
-     * @return the type of mobile network we are on
-     */
-    private String getType(NetworkInfo info) {
-        if (info != null) {
-            String type = info.getTypeName(); 
-
-            if (type.toLowerCase().equals(WIFI)) {
-                return TYPE_WIFI;
-            }
-            else if (type.toLowerCase().equals(MOBILE)) {
-                type = info.getSubtypeName();
-                if (type.toLowerCase().equals(GSM) || 
-                        type.toLowerCase().equals(GPRS) ||
-                        type.toLowerCase().equals(EDGE)) {
-                    return TYPE_2G;
-                }
-                else if (type.toLowerCase().startsWith(CDMA) || 
-                        type.toLowerCase().equals(UMTS)  ||
-                        type.toLowerCase().equals(ONEXRTT) ||
-                        type.toLowerCase().equals(EHRPD) ||
-                        type.toLowerCase().equals(HSUPA) ||
-                        type.toLowerCase().equals(HSDPA) ||
-                        type.toLowerCase().equals(HSPA)) {
-                    return TYPE_3G;
-                }
-                else if (type.toLowerCase().equals(LTE) || 
-                        type.toLowerCase().equals(UMB) ||
-                        type.toLowerCase().equals(HSPA_PLUS)) {
-                    return TYPE_4G;
-                }
-            }
-        } 
-        else {
-            return TYPE_NONE;
-        }
-        return TYPE_UNKNOWN;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/Notification.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/Notification.java b/framework/src/com/phonegap/Notification.java
deleted file mode 100755
index fc053a2..0000000
--- a/framework/src/com/phonegap/Notification.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import com.phonegap.api.Plugin;
-import com.phonegap.api.PhonegapActivity;
-import com.phonegap.api.PluginResult;
-import android.app.AlertDialog;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.media.Ringtone;
-import android.media.RingtoneManager;
-import android.net.Uri;
-import android.os.Vibrator;
-
-/**
- * This class provides access to notifications on the device.
- */
-public class Notification extends Plugin {
-	
-	public int confirmResult = -1;
-	public ProgressDialog spinnerDialog = null;
-	public ProgressDialog progressDialog = null;	
-	
-	/**
-	 * Constructor.
-	 */
-	public Notification() {
-	}
-
-	/**
-	 * Executes the request and returns PluginResult.
-	 * 
-	 * @param action 		The action to execute.
-	 * @param args 			JSONArry of arguments for the plugin.
-	 * @param callbackId	The callback id used when calling back into JavaScript.
-	 * @return 				A PluginResult object with a status and message.
-	 */
-	public PluginResult execute(String action, JSONArray args, String callbackId) {
-		PluginResult.Status status = PluginResult.Status.OK;
-		String result = "";		
-		
-		try {
-			if (action.equals("beep")) {
-				this.beep(args.getLong(0));
-			}
-			else if (action.equals("vibrate")) {
-				this.vibrate(args.getLong(0));
-			}
-			else if (action.equals("alert")) {
-				this.alert(args.getString(0),args.getString(1),args.getString(2), callbackId);
-				PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
-				r.setKeepCallback(true);
-				return r;
-			}
-			else if (action.equals("confirm")) {
-				this.confirm(args.getString(0),args.getString(1),args.getString(2), callbackId);
-				PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
-				r.setKeepCallback(true);
-				return r;
-			}
-			else if (action.equals("activityStart")) {
-				this.activityStart(args.getString(0),args.getString(1));
-			}
-			else if (action.equals("activityStop")) {
-				this.activityStop();
-			}
-			else if (action.equals("progressStart")) {
-				this.progressStart(args.getString(0),args.getString(1));
-			}
-			else if (action.equals("progressValue")) {
-				this.progressValue(args.getInt(0));
-			}
-			else if (action.equals("progressStop")) {
-				this.progressStop();
-			}
-			return new PluginResult(status, result);
-		} catch (JSONException e) {
-			return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
-		}
-	}
-
-	/**
-	 * Identifies if action to be executed returns a value and should be run synchronously.
-	 * 
-	 * @param action	The action to execute
-	 * @return			T=returns value
-	 */
-	public boolean isSynch(String action) {
-		if (action.equals("alert")) {
-			return true;
-		}
-		else if (action.equals("confirm")) {
-			return true;
-		}
-		else if (action.equals("activityStart")) {
-			return true;
-		}
-		else if (action.equals("activityStop")) {
-			return true;
-		}
-		else if (action.equals("progressStart")) {
-			return true;
-		}
-		else if (action.equals("progressValue")) {
-			return true;
-		}
-		else if (action.equals("progressStop")) {
-			return true;
-		}
-		else {
-			return false;
-		}
-	}
-
-    //--------------------------------------------------------------------------
-    // LOCAL METHODS
-    //--------------------------------------------------------------------------
-
-	/**
-	 * Beep plays the default notification ringtone.
-	 * 
-	 * @param count			Number of times to play notification
-	 */
-	public void beep(long count) {
-		Uri ringtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
-		Ringtone notification = RingtoneManager.getRingtone(this.ctx, ringtone);
-		
-		// If phone is not set to silent mode
-		if (notification != null) {
-			for (long i = 0; i < count; ++i) {
-				notification.play();
-				long timeout = 5000;
-				while (notification.isPlaying() && (timeout > 0)) {
-					timeout = timeout - 100;
-					try {
-						Thread.sleep(100);
-					} catch (InterruptedException e) {
-					}
-				}
-			}
-		}
-	}
-	
-	/**
-	 * Vibrates the device for the specified amount of time.
-	 * 
-	 * @param time			Time to vibrate in ms.
-	 */
-	public void vibrate(long time){
-        // Start the vibration, 0 defaults to half a second.
-		if (time == 0) {
-			time = 500;
-		}
-        Vibrator vibrator = (Vibrator) this.ctx.getSystemService(Context.VIBRATOR_SERVICE);
-        vibrator.vibrate(time);
-	}
-	
-	/**
-	 * Builds and shows a native Android alert with given Strings
-	 * @param message 		The message the alert should display
-	 * @param title 		The title of the alert
-	 * @param buttonLabel 	The label of the button 
-	 * @param callbackId	The callback id
-	 */
-	public synchronized void alert(final String message, final String title, final String buttonLabel, final String callbackId) {
-
-		final PhonegapActivity ctx = this.ctx;
-		final Notification notification = this;
-		
-		Runnable runnable = new Runnable() {
-			public void run() {
-		
-				AlertDialog.Builder dlg = new AlertDialog.Builder(ctx);
-				dlg.setMessage(message);
-				dlg.setTitle(title);
-				dlg.setCancelable(false);
-				dlg.setPositiveButton(buttonLabel,
-						new AlertDialog.OnClickListener() {
-					public void onClick(DialogInterface dialog, int which) {
-						dialog.dismiss();
-						notification.success(new PluginResult(PluginResult.Status.OK, 0), callbackId);
-					}
-				});
-				dlg.create();
-				dlg.show();
-			};
-		};
-		this.ctx.runOnUiThread(runnable);
-	}
-
-	/**
-	 * Builds and shows a native Android confirm dialog with given title, message, buttons.
-	 * This dialog only shows up to 3 buttons.  Any labels after that will be ignored.
-	 * The index of the button pressed will be returned to the JavaScript callback identified by callbackId.
-	 * 
-	 * @param message 		The message the dialog should display
-	 * @param title 		The title of the dialog
-	 * @param buttonLabels 	A comma separated list of button labels (Up to 3 buttons)
-	 * @param callbackId	The callback id
-	 */
-	public synchronized void confirm(final String message, final String title, String buttonLabels, final String callbackId) {
-
-		final PhonegapActivity ctx = this.ctx;
-		final Notification notification = this;
-		final String[] fButtons = buttonLabels.split(",");
-
-		Runnable runnable = new Runnable() {
-			public void run() {
-				AlertDialog.Builder dlg = new AlertDialog.Builder(ctx);
-				dlg.setMessage(message);
-				dlg.setTitle(title);
-				dlg.setCancelable(false);
-
-				// First button
-				if (fButtons.length > 0) {
-					dlg.setPositiveButton(fButtons[0],
-							new AlertDialog.OnClickListener() {
-						public void onClick(DialogInterface dialog, int which) {
-							dialog.dismiss();
-							notification.success(new PluginResult(PluginResult.Status.OK, 1), callbackId);
-						}
-					});
-				}
-
-				// Second button
-				if (fButtons.length > 1) {
-					dlg.setNeutralButton(fButtons[1], 
-							new AlertDialog.OnClickListener() {
-						public void onClick(DialogInterface dialog, int which) {
-							dialog.dismiss();
-							notification.success(new PluginResult(PluginResult.Status.OK, 2), callbackId);
-						}
-					});
-				}
-
-				// Third button
-				if (fButtons.length > 2) {
-					dlg.setNegativeButton(fButtons[2],
-							new AlertDialog.OnClickListener() {
-						public void onClick(DialogInterface dialog, int which) {
-							dialog.dismiss();
-							notification.success(new PluginResult(PluginResult.Status.OK, 3), callbackId);
-						}
-					}
-					);
-				}
-
-				dlg.create();
-				dlg.show();
-			};
-		};
-		this.ctx.runOnUiThread(runnable);
-	}
-
-	/**
-	 * Show the spinner.
-	 * 
-	 * @param title			Title of the dialog
-	 * @param message		The message of the dialog
-	 */
-	public synchronized void activityStart(final String title, final String message) {
-		if (this.spinnerDialog != null) {
-			this.spinnerDialog.dismiss();
-			this.spinnerDialog = null;
-		}
-		final Notification notification = this;
-		final PhonegapActivity ctx = this.ctx;
-		Runnable runnable = new Runnable() {
-			public void run() {
-				notification.spinnerDialog = ProgressDialog.show(ctx, title , message, true, true, 
-					new DialogInterface.OnCancelListener() { 
-						public void onCancel(DialogInterface dialog) {
-							notification.spinnerDialog = null;
-						}
-					});
-				}
-			};
-		this.ctx.runOnUiThread(runnable);
-	}
-	
-	/**
-	 * Stop spinner.
-	 */
-	public synchronized void activityStop() {
-		if (this.spinnerDialog != null) {
-			this.spinnerDialog.dismiss();
-			this.spinnerDialog = null;
-		}
-	}
-
-	/**
-	 * Show the progress dialog.
-	 * 
-	 * @param title			Title of the dialog
-	 * @param message		The message of the dialog
-	 */
-	public synchronized void progressStart(final String title, final String message) {
-		if (this.progressDialog != null) {
-			this.progressDialog.dismiss();
-			this.progressDialog = null;
-		}
-		final Notification notification = this;
-		final PhonegapActivity ctx = this.ctx;
-		Runnable runnable = new Runnable() {
-			public void run() {
-				notification.progressDialog = new ProgressDialog(ctx);
-				notification.progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
-				notification.progressDialog.setTitle(title);
-				notification.progressDialog.setMessage(message);
-				notification.progressDialog.setCancelable(true);
-				notification.progressDialog.setMax(100);
-				notification.progressDialog.setProgress(0);
-				notification.progressDialog.setOnCancelListener(
-					new DialogInterface.OnCancelListener() { 
-						public void onCancel(DialogInterface dialog) {
-							notification.progressDialog = null;
-						}
-					});
-				notification.progressDialog.show();
-			}
-		};
-		this.ctx.runOnUiThread(runnable);
-	}
-	
-	/**
-	 * Set value of progress bar.
-	 * 
-	 * @param value			0-100
-	 */
-	public synchronized void progressValue(int value) {
-		if (this.progressDialog != null) {
-			this.progressDialog.setProgress(value);
-		}		
-	}
-	
-	/**
-	 * Stop progress dialog.
-	 */
-	public synchronized void progressStop() {
-		if (this.progressDialog != null) {
-			this.progressDialog.dismiss();
-			this.progressDialog = null;
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/PreferenceNode.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/PreferenceNode.java b/framework/src/com/phonegap/PreferenceNode.java
deleted file mode 100644
index 2851c24..0000000
--- a/framework/src/com/phonegap/PreferenceNode.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.phonegap;
-
-// represents the <preference> element from the W3C config.xml spec
-// see http://www.w3.org/TR/widgets/#the-preference-element-and-its-attributes
-public class PreferenceNode {
-    public String name;
-    public String value;
-    public boolean readonly;
-
-    // constructor
-    public PreferenceNode(String name, String value, boolean readonly) {
-        this.name = name;
-        this.value = value;
-        this.readonly = readonly;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/PreferenceSet.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/PreferenceSet.java b/framework/src/com/phonegap/PreferenceSet.java
deleted file mode 100644
index 8603460..0000000
--- a/framework/src/com/phonegap/PreferenceSet.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.phonegap;
-
-import java.util.HashSet;
-
-import com.phonegap.PreferenceNode;
-
-public class PreferenceSet {
-    private HashSet<PreferenceNode> innerSet;
-
-    public PreferenceSet() {
-        this.innerSet = new HashSet<PreferenceNode>();
-    }
-
-    public void add(PreferenceNode node) {
-        this.innerSet.add(node);
-    }
-
-    public int size() {
-        return this.innerSet.size();
-    }
-
-    public void clear() {
-        this.innerSet.clear();
-    }
-
-    public String pref(String prefName) {
-        for (PreferenceNode n : innerSet)
-            if (prefName.equals(n.name))
-                return n.value;
-
-        return null;
-    }
-
-    public boolean prefMatches(String prefName, String prefValue) {
-        String value = pref(prefName);
-
-        if (value == null) {
-            return false;
-        } else {
-            return value.equals(prefValue);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/StandAlone.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/StandAlone.java b/framework/src/com/phonegap/StandAlone.java
deleted file mode 100644
index 51841cc..0000000
--- a/framework/src/com/phonegap/StandAlone.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap;
-
-import java.lang.reflect.Field;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class StandAlone extends DroidGap {
-	
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        
-        super.loadUrl("file:///android_asset/www/index.html");                        
-    }		
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/Storage.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/Storage.java b/framework/src/com/phonegap/Storage.java
deleted file mode 100755
index 516f6b4..0000000
--- a/framework/src/com/phonegap/Storage.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap;
-
-import java.io.File;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import com.phonegap.api.Plugin;
-import com.phonegap.api.PluginResult;
-
-import android.content.Context;
-import android.database.Cursor;
-import android.database.sqlite.*;
-
-/**
- * This class implements the HTML5 database support to work around a bug for 
- * Android 3.0 devices. It is not used for other versions of Android, since 
- * HTML5 database is built in to the browser.
- */
-public class Storage extends Plugin {
-
-	// Data Definition Language
-	private static final String ALTER = "alter";
-	private static final String CREATE = "create";
-	private static final String DROP = "drop";
-	private static final String TRUNCATE = "truncate";
-	
-	SQLiteDatabase myDb = null; // Database object
-	String path = null; // Database path
-	String dbName = null; // Database name
-
-	/**
-	 * Constructor.
-	 */
-	public Storage() {
-	}
-
-	/**
-	 * Executes the request and returns PluginResult.
-	 * 
-	 * @param action
-	 *            The action to execute.
-	 * @param args
-	 *            JSONArry of arguments for the plugin.
-	 * @param callbackId
-	 *            The callback id used when calling back into JavaScript.
-	 * @return A PluginResult object with a status and message.
-	 */
-	public PluginResult execute(String action, JSONArray args, String callbackId) {
-		PluginResult.Status status = PluginResult.Status.OK;
-		String result = "";
-
-		try {
-			if (action.equals("openDatabase")) {
-				this.openDatabase(args.getString(0), args.getString(1),
-						args.getString(2), args.getLong(3));
-			} else if (action.equals("executeSql")) {
-				String[] s = null;
-				if (args.isNull(1)) {
-					s = new String[0];
-				} else {
-					JSONArray a = args.getJSONArray(1);
-					int len = a.length();
-					s = new String[len];
-					for (int i = 0; i < len; i++) {
-						s[i] = a.getString(i);
-					}
-				}
-				this.executeSql(args.getString(0), s, args.getString(2));
-			}
-			return new PluginResult(status, result);
-		} catch (JSONException e) {
-			return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
-		}
-	}
-
-	/**
-	 * Identifies if action to be executed returns a value and should be run
-	 * synchronously.
-	 * 
-	 * @param action
-	 *            The action to execute
-	 * @return T=returns value
-	 */
-	public boolean isSynch(String action) {
-		return true;
-	}
-
-	/**
-	 * Clean up and close database.
-	 */
-	@Override
-	public void onDestroy() {
-		if (this.myDb != null) {
-			this.myDb.close();
-			this.myDb = null;
-		}
-	}
-
-	// --------------------------------------------------------------------------
-	// LOCAL METHODS
-	// --------------------------------------------------------------------------
-
-	/**
-	 * Open database.
-	 * 
-	 * @param db
-	 *            The name of the database
-	 * @param version
-	 *            The version
-	 * @param display_name
-	 *            The display name
-	 * @param size
-	 *            The size in bytes
-	 */
-	public void openDatabase(String db, String version, String display_name,
-			long size) {
-
-		// If database is open, then close it
-		if (this.myDb != null) {
-			this.myDb.close();
-		}
-
-		// If no database path, generate from application package
-		if (this.path == null) {
-			this.path = this.ctx.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
-		}
-
-		this.dbName = this.path + File.pathSeparator + db + ".db";
-		this.myDb = SQLiteDatabase.openOrCreateDatabase(this.dbName, null);
-	}
-
-	/**
-	 * Execute SQL statement.
-	 * 
-	 * @param query
-	 *            The SQL query
-	 * @param params
-	 *            Parameters for the query
-	 * @param tx_id
-	 *            Transaction id
-	 */
-	public void executeSql(String query, String[] params, String tx_id) {
-		try {
-			if (isDDL(query)) {
-				this.myDb.execSQL(query);
-				this.sendJavascript("droiddb.completeQuery('" + tx_id + "', '');");
-			} 
-			else {
-				Cursor myCursor = this.myDb.rawQuery(query, params);
-				this.processResults(myCursor, tx_id);
-				myCursor.close();
-			}
-		} 
-		catch (SQLiteException ex) {
-			ex.printStackTrace();
-			System.out.println("Storage.executeSql(): Error=" +  ex.getMessage());
-			
-			// Send error message back to JavaScript
-			this.sendJavascript("droiddb.fail('" + ex.getMessage() + "','" + tx_id + "');");
-		}
-	}
-
-	/**
-	 * Checks to see the the query is a Data Definintion command
-	 * 
-	 * @param query to be executed
-	 * @return true if it is a DDL command, false otherwise
-	 */
-	private boolean isDDL(String query) {
-		String cmd = query.toLowerCase();
-		if (cmd.startsWith(DROP) || cmd.startsWith(CREATE) || cmd.startsWith(ALTER) || cmd.startsWith(TRUNCATE)) {
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Process query results.
-	 * 
-	 * @param cur
-	 *            Cursor into query results
-	 * @param tx_id
-	 *            Transaction id
-	 */
-	public void processResults(Cursor cur, String tx_id) {
-
-		String result = "[]";
-		// If query result has rows
-
-		if (cur.moveToFirst()) {
-			JSONArray fullresult = new JSONArray();
-			String key = "";
-			String value = "";
-			int colCount = cur.getColumnCount();
-
-			// Build up JSON result object for each row
-			do {
-				JSONObject row = new JSONObject();
-				try {
-					for (int i = 0; i < colCount; ++i) {
-						key = cur.getColumnName(i);
-						value = cur.getString(i);
-						row.put(key, value);
-					}
-					fullresult.put(row);
-
-				} catch (JSONException e) {
-					e.printStackTrace();
-				}
-
-			} while (cur.moveToNext());
-
-			result = fullresult.toString();
-		}
-
-		// Let JavaScript know that there are no more rows
-		this.sendJavascript("droiddb.completeQuery('" + tx_id + "', " + result + ");");
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/TempListener.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/TempListener.java b/framework/src/com/phonegap/TempListener.java
deleted file mode 100755
index fcbdb68..0000000
--- a/framework/src/com/phonegap/TempListener.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap;
-
-import java.util.List;
-
-import org.json.JSONArray;
-
-import com.phonegap.api.PhonegapActivity;
-import com.phonegap.api.Plugin;
-import com.phonegap.api.PluginResult;
-
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-import android.content.Context;
-
-public class TempListener extends Plugin implements SensorEventListener {
-	
-    Sensor mSensor;	
-	private SensorManager sensorManager;
-	
-	/**
-	 * Constructor.
-	 */
-	public TempListener() {
-	}
-
-	/**
-	 * Sets the context of the Command. This can then be used to do things like
-	 * get file paths associated with the Activity.
-	 * 
-	 * @param ctx The context of the main Activity.
-	 */
-	public void setContext(PhonegapActivity ctx) {
-		super.setContext(ctx);
-        this.sensorManager = (SensorManager) ctx.getSystemService(Context.SENSOR_SERVICE);
-	}
-
-	/**
-	 * Executes the request and returns PluginResult.
-	 * 
-	 * @param action 		The action to execute.
-	 * @param args 			JSONArry of arguments for the plugin.
-	 * @param callbackId	The callback id used when calling back into JavaScript.
-	 * @return 				A PluginResult object with a status and message.
-	 */
-	public PluginResult execute(String action, JSONArray args, String callbackId) {
-		PluginResult.Status status = PluginResult.Status.OK;
-		String result = "";		
-		
-		if (action.equals("start")) {
-			this.start();
-		}
-		else if (action.equals("stop")) {
-			this.stop();
-		}
-		return new PluginResult(status, result);
-	}
-    
-    /**
-     * Called by AccelBroker when listener is to be shut down.
-     * Stop listener.
-     */
-    public void onDestroy() {
-    	this.stop();    	
-    }
-
-    //--------------------------------------------------------------------------
-    // LOCAL METHODS
-    //--------------------------------------------------------------------------
-
-	public void start()	{
-		List<Sensor> list = this.sensorManager.getSensorList(Sensor.TYPE_TEMPERATURE);
-		if (list.size() > 0) {
-			this.mSensor = list.get(0);
-			this.sensorManager.registerListener(this, this.mSensor, SensorManager.SENSOR_DELAY_NORMAL);
-		}
-	}
-	
-	public void stop() {
-		this.sensorManager.unregisterListener(this);
-	}
-	
-	public void onAccuracyChanged(Sensor sensor, int accuracy) {
-		// TODO Auto-generated method stub
-	}
-
-	public void onSensorChanged(SensorEvent event) {
-		// We want to know what temp this is.
-		float temp = event.values[0];
-		this.sendJavascript("gotTemp(" + temp + ");");
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/api/IPlugin.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/api/IPlugin.java b/framework/src/com/phonegap/api/IPlugin.java
deleted file mode 100755
index a825062..0000000
--- a/framework/src/com/phonegap/api/IPlugin.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap.api;
-
-import org.json.JSONArray;
-import android.content.Intent;
-import android.webkit.WebView;
-
-/**
- * Plugin interface must be implemented by any plugin classes.
- *
- * The execute method is called by the PluginManager.
- */
-public interface IPlugin {
-		
-	/**
-	 * Executes the request and returns PluginResult.
-	 * 
-	 * @param action 		The action to execute.
-	 * @param args 			JSONArry of arguments for the plugin.
-	 * @param callbackId	The callback id used when calling back into JavaScript.
-	 * @return 				A PluginResult object with a status and message.
-	 */
-	PluginResult execute(String action, JSONArray args, String callbackId);
-
-	/**
-	 * Identifies if action to be executed returns a value and should be run synchronously.
-	 * 
-	 * @param action	The action to execute
-	 * @return			T=returns value
-	 */
-	public boolean isSynch(String action);
-
-	/**
-	 * Sets the context of the Plugin. This can then be used to do things like
-	 * get file paths associated with the Activity.
-	 * 
-	 * @param ctx The context of the main Activity.
-	 */
-	void setContext(PhonegapActivity ctx);
-
-	/**
-	 * Sets the main View of the application, this is the WebView within which 
-	 * a PhoneGap app runs.
-	 * 
-	 * @param webView The PhoneGap WebView
-	 */
-	void setView(WebView webView);
-
-    /**
-     * Called when the system is about to start resuming a previous activity. 
-     * 
-     * @param multitasking		Flag indicating if multitasking is turned on for app
-     */
-    void onPause(boolean multitasking);
-
-    /**
-     * Called when the activity will start interacting with the user. 
-     * 
-     * @param multitasking		Flag indicating if multitasking is turned on for app
-     */
-    void onResume(boolean multitasking);
-    
-    /**
-     * Called when the activity receives a new intent. 
-     */
-    void onNewIntent(Intent intent);
-
-    /**
-     * The final call you receive before your activity is destroyed. 
-     */
-    void onDestroy();
-	
-    /**
-     * Called when a message is sent to plugin. 
-     * 
-     * @param id            The message id
-     * @param data          The message data
-     */
-    public void onMessage(String id, Object data);
-
-    /**
-     * Called when an activity you launched exits, giving you the requestCode you started it with,
-     * the resultCode it returned, and any additional data from it. 
-     * 
-     * @param requestCode		The request code originally supplied to startActivityForResult(), 
-     * 							allowing you to identify who this result came from.
-     * @param resultCode		The integer result code returned by the child activity through its setResult().
-     * @param data				An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
-     */
-    void onActivityResult(int requestCode, int resultCode, Intent intent);
-
-    /**
-     * By specifying a <url-filter> in plugins.xml you can map a URL (using startsWith atm) to this method.
-     * 
-     * @param url				The URL that is trying to be loaded in the PhoneGap webview.
-     * @return					Return true to prevent the URL from loading. Default is false.
-     */
-    boolean onOverrideUrlLoading(String url);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/api/LOG.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/api/LOG.java b/framework/src/com/phonegap/api/LOG.java
deleted file mode 100755
index 202750a..0000000
--- a/framework/src/com/phonegap/api/LOG.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap.api;
-
-import android.util.Log;
-
-/**
- * Log to Android logging system.
- * 
- * Log message can be a string or a printf formatted string with arguments.
- * See http://developer.android.com/reference/java/util/Formatter.html
- */
-public class LOG {
-    
-    public static final int VERBOSE = Log.VERBOSE;
-    public static final int DEBUG = Log.DEBUG;
-    public static final int INFO = Log.INFO;
-    public static final int WARN = Log.WARN;
-    public static final int ERROR = Log.ERROR;
-
-    // Current log level
-    public static int LOGLEVEL = Log.ERROR;
-    
-    /**
-     * Set the current log level.
-     * 
-     * @param logLevel
-     */
-    public static void setLogLevel(int logLevel) {
-        LOGLEVEL = logLevel;
-        Log.i("PhoneGapLog", "Changing log level to " + logLevel);
-    }
-    
-    /**
-     * Set the current log level.
-     * 
-     * @param logLevel
-     */
-    public static void setLogLevel(String logLevel) {
-        if ("VERBOSE".equals(logLevel)) LOGLEVEL = VERBOSE;
-        else if ("DEBUG".equals(logLevel)) LOGLEVEL = DEBUG;
-        else if ("INFO".equals(logLevel)) LOGLEVEL = INFO;
-        else if ("WARN".equals(logLevel)) LOGLEVEL = WARN;
-        else if ("ERROR".equals(logLevel)) LOGLEVEL = ERROR;
-        Log.i("PhoneGapLog", "Changing log level to " + logLevel + "(" + LOGLEVEL + ")");
-    }
-
-    /**
-     * Determine if log level will be logged
-     * 
-     * @param logLevel
-     * @return
-     */
-    public static boolean isLoggable(int logLevel) {
-        return (logLevel >= LOGLEVEL);
-    }
-
-    /**
-     * Verbose log message.
-     * 
-     * @param tag
-     * @param s
-     */
-    public static void v(String tag, String s) {
-        if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, s);
-    }
-
-    /**
-     * Debug log message.
-     * 
-     * @param tag
-     * @param s
-     */
-    public static void d(String tag, String s) {
-        if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, s);
-    }
-    
-    /**
-     * Info log message.
-     * 
-     * @param tag
-     * @param s
-     */
-    public static void i(String tag, String s) {
-        if (LOG.INFO >= LOGLEVEL) Log.i(tag, s);
-    }
-
-    /**
-     * Warning log message.
-     * 
-     * @param tag
-     * @param s
-     */
-    public static void w(String tag, String s) {
-        if (LOG.WARN >= LOGLEVEL) Log.w(tag, s);
-    }
-
-    /**
-     * Error log message.
-     * 
-     * @param tag
-     * @param s
-     */
-    public static void e(String tag, String s) {
-        if (LOG.ERROR >= LOGLEVEL) Log.e(tag, s);
-    }
-
-    /**
-     * Verbose log message.
-     * 
-     * @param tag
-     * @param s
-     * @param e
-     */
-    public static void v(String tag, String s, Throwable e) {
-        if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, s, e);
-    }
-
-    /**
-     * Debug log message.
-     * 
-     * @param tag
-     * @param s
-     * @param e
-     */
-    public static void d(String tag, String s, Throwable e) {
-        if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, s, e);
-    }
-    
-    /**
-     * Info log message.
-     * 
-     * @param tag
-     * @param s
-     * @param e
-     */
-    public static void i(String tag, String s, Throwable e) {
-        if (LOG.INFO >= LOGLEVEL) Log.i(tag, s, e);
-    }
-
-    /**
-     * Warning log message.
-     * 
-     * @param tag
-     * @param s
-     * @param e
-     */
-    public static void w(String tag, String s, Throwable e) {
-        if (LOG.WARN >= LOGLEVEL) Log.w(tag, s, e);
-    }
-
-    /**
-     * Error log message.
-     * 
-     * @param tag
-     * @param s
-     * @param e
-     */
-    public static void e(String tag, String s, Throwable e) {
-        if (LOG.ERROR >= LOGLEVEL) Log.e(tag, s, e);
-    }
-
-    /**
-     * Verbose log message with printf formatting.
-     * 
-     * @param tag
-     * @param s
-     * @param args
-     */
-    public static void v(String tag, String s, Object... args) {
-        if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, String.format(s, args));
-    }
-
-    /**
-     * Debug log message with printf formatting.
-     * 
-     * @param tag
-     * @param s
-     * @param args
-     */
-    public static void d(String tag, String s, Object... args) {
-        if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, String.format(s, args));
-    }
-
-    /**
-     * Info log message with printf formatting.
-     * 
-     * @param tag
-     * @param s
-     * @param args
-     */
-    public static void i(String tag, String s, Object... args) {
-        if (LOG.INFO >= LOGLEVEL) Log.i(tag, String.format(s, args));
-    }
-    
-    /**
-     * Warning log message with printf formatting.
-     * 
-     * @param tag
-     * @param s
-     * @param args
-     */
-    public static void w(String tag, String s, Object... args) {
-        if (LOG.WARN >= LOGLEVEL) Log.w(tag, String.format(s, args));
-    }
-    
-    /**
-     * Error log message with printf formatting.
-     * 
-     * @param tag
-     * @param s
-     * @param args
-     */
-    public static void e(String tag, String s, Object... args) {
-        if (LOG.ERROR >= LOGLEVEL) Log.e(tag, String.format(s, args));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/api/PhonegapActivity.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/api/PhonegapActivity.java b/framework/src/com/phonegap/api/PhonegapActivity.java
deleted file mode 100755
index cb3c871..0000000
--- a/framework/src/com/phonegap/api/PhonegapActivity.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap.api;
-
-import android.app.Activity;
-import android.content.Intent;
-
-/**
- * The Phonegap activity abstract class that is extended by DroidGap.
- * It is used to isolate plugin development, and remove dependency on entire Phonegap library.
- */
-public abstract class PhonegapActivity extends Activity {
-
-    /**
-     * @deprecated
-     * Add services to res/xml/plugins.xml instead.
-     * 
-     * Add a class that implements a service.
-     * 
-     * @param serviceType
-     * @param className
-     */
-    @Deprecated
-    abstract public void addService(String serviceType, String className);
-    
-    /**
-     * Send JavaScript statement back to JavaScript.
-     * 
-     * @param message
-     */
-    abstract public void sendJavascript(String statement);
-
-    /**
-     * Launch an activity for which you would like a result when it finished. When this activity exits, 
-     * your onActivityResult() method will be called.
-     *  
-     * @param command			The command object
-     * @param intent			The intent to start
-     * @param requestCode		The request code that is passed to callback to identify the activity
-     */
-    abstract public void startActivityForResult(IPlugin command, Intent intent, int requestCode);
-
-    /**
-     * Set the plugin to be called when a sub-activity exits.
-     * 
-     * @param plugin			The plugin on which onActivityResult is to be called
-     */
-    abstract public void setActivityResultCallback(IPlugin plugin);
-
-    /**
-     * Load the specified URL in the PhoneGap webview.
-     * 
-     * @param url				The URL to load.
-     */
-    abstract public void loadUrl(String url);
-    
-    /**
-     * Send a message to all plugins. 
-     * 
-     * @param id            The message id
-     * @param data          The message data
-     */
-    abstract public void postMessage(String id, Object data);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/api/Plugin.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/api/Plugin.java b/framework/src/com/phonegap/api/Plugin.java
deleted file mode 100755
index b6775e7..0000000
--- a/framework/src/com/phonegap/api/Plugin.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap.api;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-import android.content.Intent;
-import android.webkit.WebView;
-
-/**
- * Plugin interface must be implemented by any plugin classes.
- *
- * The execute method is called by the PluginManager.
- */
-public abstract class Plugin implements IPlugin {
-
-	public String id;
-    public WebView webView;					// WebView object
-    public PhonegapActivity ctx;			// PhonegapActivity object
-
-	/**
-	 * Executes the request and returns PluginResult.
-	 * 
-	 * @param action 		The action to execute.
-	 * @param args 			JSONArry of arguments for the plugin.
-	 * @param callbackId	The callback id used when calling back into JavaScript.
-	 * @return 				A PluginResult object with a status and message.
-	 */
-	public abstract PluginResult execute(String action, JSONArray args, String callbackId);
-
-	/**
-	 * Identifies if action to be executed returns a value and should be run synchronously.
-	 * 
-	 * @param action	The action to execute
-	 * @return			T=returns value
-	 */
-	public boolean isSynch(String action) {
-		return false;
-	}
-
-	/**
-	 * Sets the context of the Plugin. This can then be used to do things like
-	 * get file paths associated with the Activity.
-	 * 
-	 * @param ctx The context of the main Activity.
-	 */
-	public void setContext(PhonegapActivity ctx) {
-		this.ctx = ctx;
-	}
-
-	/**
-	 * Sets the main View of the application, this is the WebView within which 
-	 * a PhoneGap app runs.
-	 * 
-	 * @param webView The PhoneGap WebView
-	 */
-	public void setView(WebView webView) {
-		this.webView = webView;
-	}
-	
-    /**
-     * Called when the system is about to start resuming a previous activity. 
-     * 
-     * @param multitasking		Flag indicating if multitasking is turned on for app
-     */
-    public void onPause(boolean multitasking) {
-    }
-
-    /**
-     * Called when the activity will start interacting with the user. 
-     * 
-     * @param multitasking		Flag indicating if multitasking is turned on for app
-     */
-    public void onResume(boolean multitasking) {
-    }
-    
-    /**
-     * Called when the activity receives a new intent. 
-     */
-    public void onNewIntent(Intent intent) {
-    }
-    
-    /**
-     * The final call you receive before your activity is destroyed. 
-     */
-    public void onDestroy() {
-    }
-	
-    /**
-     * Called when a message is sent to plugin. 
-     * 
-     * @param id            The message id
-     * @param data          The message data
-     */
-    public void onMessage(String id, Object data) {
-    }
-
-    /**
-     * Called when an activity you launched exits, giving you the requestCode you started it with,
-     * the resultCode it returned, and any additional data from it. 
-     * 
-     * @param requestCode		The request code originally supplied to startActivityForResult(), 
-     * 							allowing you to identify who this result came from.
-     * @param resultCode		The integer result code returned by the child activity through its setResult().
-     * @param data				An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
-     */
-    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
-    }
-
-    /**
-     * By specifying a <url-filter> in plugins.xml you can map a URL (using startsWith atm) to this method.
-     * 
-     * @param url				The URL that is trying to be loaded in the PhoneGap webview.
-     * @return					Return true to prevent the URL from loading. Default is false.
-     */
-    public boolean onOverrideUrlLoading(String url) {
-    	return false;
-    }
-
-    /**
-     * Send generic JavaScript statement back to JavaScript.
-     * success(...) and error(...) should be used instead where possible.
-     * 
-     * @param statement
-     */
-    public void sendJavascript(String statement) {
-    	this.ctx.sendJavascript(statement);
-    }
-
-    /**
-     * Call the JavaScript success callback for this plugin.
-     * 
-     * This can be used if the execute code for the plugin is asynchronous meaning
-     * that execute should return null and the callback from the async operation can
-     * call success(...) or error(...)
-     * 
-     * @param pluginResult		The result to return.
-	 * @param callbackId		The callback id used when calling back into JavaScript.
-     */
-    public void success(PluginResult pluginResult, String callbackId) {
-    	this.ctx.sendJavascript(pluginResult.toSuccessCallbackString(callbackId));
-    }
-
-    /**
-     * Helper for success callbacks that just returns the Status.OK by default
-     * 
-     * @param message			The message to add to the success result.
-     * @param callbackId		The callback id used when calling back into JavaScript.
-     */
-    public void success(JSONObject message, String callbackId) {
-    	this.ctx.sendJavascript(new PluginResult(PluginResult.Status.OK, message).toSuccessCallbackString(callbackId));
-    }
-
-    /**
-     * Helper for success callbacks that just returns the Status.OK by default
-     * 
-     * @param message			The message to add to the success result.
-     * @param callbackId		The callback id used when calling back into JavaScript.
-     */
-    public void success(String message, String callbackId) {
-    	this.ctx.sendJavascript(new PluginResult(PluginResult.Status.OK, message).toSuccessCallbackString(callbackId));
-    }
-    
-    /**
-     * Call the JavaScript error callback for this plugin.
-     * 
-     * @param pluginResult		The result to return.
-	 * @param callbackId		The callback id used when calling back into JavaScript.
-     */
-    public void error(PluginResult pluginResult, String callbackId) {
-    	this.ctx.sendJavascript(pluginResult.toErrorCallbackString(callbackId));
-    }
-
-    /**
-     * Helper for error callbacks that just returns the Status.ERROR by default
-     * 
-     * @param message			The message to add to the error result.
-     * @param callbackId		The callback id used when calling back into JavaScript.
-     */
-    public void error(JSONObject message, String callbackId) {
-    	this.ctx.sendJavascript(new PluginResult(PluginResult.Status.ERROR, message).toErrorCallbackString(callbackId));
-    }
-
-    /**
-     * Helper for error callbacks that just returns the Status.ERROR by default
-     * 
-     * @param message			The message to add to the error result.
-     * @param callbackId		The callback id used when calling back into JavaScript.
-     */
-    public void error(String message, String callbackId) {
-    	this.ctx.sendJavascript(new PluginResult(PluginResult.Status.ERROR, message).toErrorCallbackString(callbackId));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/api/PluginManager.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/api/PluginManager.java b/framework/src/com/phonegap/api/PluginManager.java
deleted file mode 100755
index 6bf9f66..0000000
--- a/framework/src/com/phonegap/api/PluginManager.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap.api;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.xmlpull.v1.XmlPullParserException;
-
-import android.content.Intent;
-import android.content.res.XmlResourceParser;
-import android.util.Log;
-import android.webkit.WebView;
-
-/**
- * PluginManager is exposed to JavaScript in the PhoneGap WebView.
- * 
- * Calling native plugin code can be done by calling PluginManager.exec(...)
- * from JavaScript.
- */
-public final class PluginManager {
-
-	private HashMap<String, IPlugin> plugins = new HashMap<String,IPlugin>();
-	private HashMap<String, String> services = new HashMap<String,String>();
-	
-	private final PhonegapActivity ctx;
-	private final WebView app;
-	
-    // Map URL schemes like foo: to plugins that want to handle those schemes
-    // This would allow how all URLs are handled to be offloaded to a plugin
-    protected HashMap<String, String> urlMap = new HashMap<String,String>();
-	
-	/**
-	 * Constructor.
-	 * 
-	 * @param app
-	 * @param ctx
-	 */
-	public PluginManager(WebView app, PhonegapActivity ctx) {
-		this.ctx = ctx;
-		this.app = app;
-		this.loadPlugins();
-	}
-	
-	/**
-	 * Re-init when loading a new HTML page into webview.
-	 */
-	public void reinit() {
-	    
-	    // Stop plugins on current HTML page and discard
-	    this.onPause(false);
-	    this.onDestroy();
-	    this.plugins = new HashMap<String, IPlugin>();
-	}
-	
-	/**
-	 * Load plugins from res/xml/plugins.xml
-	 */
-	public void loadPlugins() {
-		int id = ctx.getResources().getIdentifier("plugins", "xml", ctx.getPackageName());
-		if (id == 0) { pluginConfigurationMissing(); }
-		XmlResourceParser xml = ctx.getResources().getXml(id);
-		int eventType = -1;
-		String pluginClass = "", pluginName = "";
-		while (eventType != XmlResourceParser.END_DOCUMENT) {
-			if (eventType == XmlResourceParser.START_TAG) {
-				String strNode = xml.getName();
-				if (strNode.equals("plugin")) {
-					pluginClass = xml.getAttributeValue(null, "value");
-					pluginName = xml.getAttributeValue(null, "name");
-					//System.out.println("Plugin: "+name+" => "+value);
-					this.addService(pluginName, pluginClass);
-					
-					// Create plugin at load time if attribute "onload"
-					if ("true".equals(xml.getAttributeValue(null, "onload"))) {
-					    this.getPlugin(pluginName);
-					}
-				} else if (strNode.equals("url-filter")) {
-					this.urlMap.put(xml.getAttributeValue(null, "value"), pluginName);
-				}
-			}
-			try {
-				eventType = xml.next();
-			} catch (XmlPullParserException e) {
-				e.printStackTrace();
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		}
-	}
-
-	/**
-	 * Receives a request for execution and fulfills it by finding the appropriate
-	 * Java class and calling it's execute method.
-	 * 
-	 * PluginManager.exec can be used either synchronously or async. In either case, a JSON encoded 
-	 * string is returned that will indicate if any errors have occurred when trying to find
-	 * or execute the class denoted by the clazz argument.
-	 * 
-	 * @param service 		String containing the service to run
-	 * @param action 		String containt the action that the class is supposed to perform. This is
-	 * 						passed to the plugin execute method and it is up to the plugin developer 
-	 * 						how to deal with it.
-	 * @param callbackId 	String containing the id of the callback that is execute in JavaScript if
-	 * 						this is an async plugin call.
-	 * @param args 			An Array literal string containing any arguments needed in the
-	 * 						plugin execute method.
-	 * @param async 		Boolean indicating whether the calling JavaScript code is expecting an
-	 * 						immediate return value. If true, either PhoneGap.callbackSuccess(...) or 
-	 * 						PhoneGap.callbackError(...) is called once the plugin code has executed.
-	 * 
-	 * @return 				JSON encoded string with a response message and status.
-	 */
-	@SuppressWarnings("unchecked")
-	public String exec(final String service, final String action, final String callbackId, final String jsonArgs, final boolean async) {
-		PluginResult cr = null;
-		boolean runAsync = async;
-		try {
-			final JSONArray args = new JSONArray(jsonArgs);
-			final IPlugin plugin = this.getPlugin(service); 
-			final PhonegapActivity ctx = this.ctx;
-			if (plugin != null) {
-				runAsync = async && !plugin.isSynch(action);
-				if (runAsync) {
-					// Run this on a different thread so that this one can return back to JS
-					Thread thread = new Thread(new Runnable() {
-						public void run() {
-							try {
-								// Call execute on the plugin so that it can do it's thing
-								PluginResult cr = plugin.execute(action, args, callbackId);
-								int status = cr.getStatus();
-
-								// If no result to be sent and keeping callback, then no need to sent back to JavaScript
-								if ((status == PluginResult.Status.NO_RESULT.ordinal()) && cr.getKeepCallback()) {
-								}
-
-								// Check the success (OK, NO_RESULT & !KEEP_CALLBACK)
-								else if ((status == PluginResult.Status.OK.ordinal()) || (status == PluginResult.Status.NO_RESULT.ordinal())) {
-									ctx.sendJavascript(cr.toSuccessCallbackString(callbackId));
-								} 
-								
-								// If error
-								else {
-									ctx.sendJavascript(cr.toErrorCallbackString(callbackId));
-								}
-							} catch (Exception e) {
-								PluginResult cr = new PluginResult(PluginResult.Status.ERROR, e.getMessage());
-								ctx.sendJavascript(cr.toErrorCallbackString(callbackId));
-							}
-						}
-					});
-					thread.start();
-					return "";
-				} else {
-					// Call execute on the plugin so that it can do it's thing
-					cr = plugin.execute(action, args, callbackId);
-
-					// If no result to be sent and keeping callback, then no need to sent back to JavaScript
-					if ((cr.getStatus() == PluginResult.Status.NO_RESULT.ordinal()) && cr.getKeepCallback()) {
-						return "";
-					}
-				}
-			}
-		} catch (JSONException e) {
-			System.out.println("ERROR: "+e.toString());
-			cr = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
-		}
-		// if async we have already returned at this point unless there was an error...
-		if (runAsync) {
-			if (cr == null) {
-				cr = new PluginResult(PluginResult.Status.CLASS_NOT_FOUND_EXCEPTION);				
-			}
-			ctx.sendJavascript(cr.toErrorCallbackString(callbackId));
-		}
-		return ( cr != null ? cr.getJSONString() : "{ status: 0, message: 'all good' }" );
-	}
-	
-	/**
-	 * Get the class.
-	 * 
-	 * @param clazz
-	 * @return
-	 * @throws ClassNotFoundException
-	 */
-	@SuppressWarnings("unchecked")
-	private Class getClassByName(final String clazz) throws ClassNotFoundException {
-		Class c = null;
-		if (clazz != null) {
-			c = Class.forName(clazz);
-		}
-		return c;
-	}
-
-	/**
-	 * Get the interfaces that a class implements and see if it implements the
-	 * com.phonegap.api.Plugin interface.
-	 * 
-	 * @param c The class to check the interfaces of.
-	 * @return Boolean indicating if the class implements com.phonegap.api.Plugin
-	 */
-	@SuppressWarnings("unchecked")
-	private boolean isPhoneGapPlugin(Class c) {
-		if (c != null) {
-			return com.phonegap.api.Plugin.class.isAssignableFrom(c) || com.phonegap.api.IPlugin.class.isAssignableFrom(c);
-		}
-		return false;
-	}
-
-    /**
-     * Add plugin to be loaded and cached.  This creates an instance of the plugin.
-     * If plugin is already created, then just return it.
-     * 
-     * @param className				The class to load
-     * @param clazz					The class object (must be a class object of the className)
-     * @param callbackId			The callback id to use when calling back into JavaScript
-     * @return						The plugin
-     */
-	@SuppressWarnings("unchecked")
-	private IPlugin addPlugin(String pluginName, String className) {
-		try {
-			Class c = getClassByName(className);
-			if (isPhoneGapPlugin(c)) {
-				IPlugin plugin = (IPlugin)c.newInstance();
-				this.plugins.put(className, plugin);
-				plugin.setContext(this.ctx);
-				plugin.setView(this.app);
-				return plugin;
-			}
-    	} catch (Exception e) {
-    		  e.printStackTrace();
-    		  System.out.println("Error adding plugin "+className+".");
-    	}
-    	return null;
-    }
-    
-    /**
-     * Get the loaded plugin.
-     * 
-     * If the plugin is not already loaded then load it.
-     * 
-     * @param className				The class of the loaded plugin.
-     * @return
-     */
-    private IPlugin getPlugin(String pluginName) {
-		String className = this.services.get(pluginName);
-    	if (this.plugins.containsKey(className)) {
-    		return this.plugins.get(className);
-    	} else {
-	    	return this.addPlugin(pluginName, className);
-	    }
-    }
-    
-    /**
-     * Add a class that implements a service.
-     * This does not create the class instance.  It just maps service name to class name.
-     * 
-     * @param serviceType
-     * @param className
-     */
-    public void addService(String serviceType, String className) {
-    	this.services.put(serviceType, className);
-    }
-
-    /**
-     * Called when the system is about to start resuming a previous activity. 
-     * 
-     * @param multitasking		Flag indicating if multitasking is turned on for app
-     */
-    public void onPause(boolean multitasking) {
-        for (IPlugin plugin : this.plugins.values()) {
-            plugin.onPause(multitasking);
-        }
-    }
-    
-    /**
-     * Called when the activity will start interacting with the user. 
-     * 
-     * @param multitasking		Flag indicating if multitasking is turned on for app
-     */
-    public void onResume(boolean multitasking) {
-        for (IPlugin plugin : this.plugins.values()) {
-            plugin.onResume(multitasking);
-        }
-    }
-
-    /**
-     * The final call you receive before your activity is destroyed. 
-     */
-    public void onDestroy() {
-        for (IPlugin plugin : this.plugins.values()) {
-            plugin.onDestroy();
-        }
-    }
-
-    /**
-     * Send a message to all plugins. 
-     * 
-     * @param id            The message id
-     * @param data          The message data
-     */
-    public void postMessage(String id, Object data) {
-        for (IPlugin plugin : this.plugins.values()) {
-            plugin.onMessage(id, data);
-        }
-    }
-
-    /**
-     * Called when the activity receives a new intent. 
-     */    
-    public void onNewIntent(Intent intent) {
-        for (IPlugin plugin : this.plugins.values()) {
-            plugin.onNewIntent(intent);
-        }
-    }
-
-    /**
-     * Called when the URL of the webview changes.
-     * 
-     * @param url The URL that is being changed to.
-     * @return Return false to allow the URL to load, return true to prevent the URL from loading.
-     */
-    public boolean onOverrideUrlLoading(String url) {
-    	Iterator<Entry<String, String>> it = this.urlMap.entrySet().iterator();
-        while (it.hasNext()) {
-            HashMap.Entry<String, String> pairs = it.next();
-            if (url.startsWith(pairs.getKey())) {
-            	return this.getPlugin(pairs.getValue()).onOverrideUrlLoading(url);
-            }
-        }
-    	return false;
-    }
-
-	private void pluginConfigurationMissing() {
-		System.err.println("=====================================================================================");
-		System.err.println("ERROR: plugin.xml is missing.  Add res/xml/plugins.xml to your project.");      
-		System.err.println("https://raw.github.com/phonegap/phonegap-android/master/framework/res/xml/plugins.xml");        
-		System.err.println("=====================================================================================");
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/api/PluginResult.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/api/PluginResult.java b/framework/src/com/phonegap/api/PluginResult.java
deleted file mode 100755
index f09798e..0000000
--- a/framework/src/com/phonegap/api/PluginResult.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package com.phonegap.api;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-import android.util.Log;
-
-public class PluginResult {
-	private final int status;
-	private final String message;
-	private boolean keepCallback = false;
-	private String cast = null;
-	
-	public PluginResult(Status status) {
-		this.status = status.ordinal();
-		this.message = "'" + PluginResult.StatusMessages[this.status] + "'";
-	}
-	
-	public PluginResult(Status status, String message) {
-		this.status = status.ordinal();
-		this.message = JSONObject.quote(message);
-	}
-
-	public PluginResult(Status status, JSONArray message, String cast) {
-		this.status = status.ordinal();
-		this.message = message.toString();
-		this.cast = cast;
-	}
-
-	public PluginResult(Status status, JSONObject message, String cast) {
-		this.status = status.ordinal();
-		this.message = message.toString();
-		this.cast = cast;
-	}
-
-	public PluginResult(Status status, JSONArray message) {
-		this.status = status.ordinal();
-		this.message = message.toString();
-	}
-
-	public PluginResult(Status status, JSONObject message) {
-		this.status = status.ordinal();
-		this.message = message.toString();
-	}
-
-	public PluginResult(Status status, int i) {
-		this.status = status.ordinal();
-		this.message = ""+i;
-	}
-
-	public PluginResult(Status status, float f) {
-		this.status = status.ordinal();
-		this.message = ""+f;
-	}
-
-	public PluginResult(Status status, boolean b) {
-		this.status = status.ordinal();
-		this.message = ""+b;
-	}
-	
-	public void setKeepCallback(boolean b) {
-		this.keepCallback = b;
-	}
-	
-	public int getStatus() {
-		return status;
-	}
-
-	public String getMessage() {
-		return message;
-	}
-	
-	public boolean getKeepCallback() {
-		return this.keepCallback;
-	}
-	
-	public String getJSONString() {
-		return "{status:" + this.status + ",message:" + this.message + ",keepCallback:" + this.keepCallback + "}";
-	}
-	
-	public String toSuccessCallbackString(String callbackId) {
-		StringBuffer buf = new StringBuffer("");
-		if (cast != null) {
-			buf.append("var temp = "+cast+"("+this.getJSONString() + ");\n");
-			buf.append("PhoneGap.callbackSuccess('"+callbackId+"',temp);");
-		}
-		else {
-			buf.append("PhoneGap.callbackSuccess('"+callbackId+"',"+this.getJSONString()+");");			
-		}
-		return buf.toString();
-	}
-	
-	public String toErrorCallbackString(String callbackId) {
-		return "PhoneGap.callbackError('"+callbackId+"', " + this.getJSONString()+ ");";
-	}
-	
-	public static String[] StatusMessages = new String[] {
-		"No result",
-		"OK",
-		"Class not found",
-		"Illegal access",
-		"Instantiation error",
-		"Malformed url",
-		"IO error",
-		"Invalid action",
-		"JSON error",
-		"Error"
-	};
-	
-	public enum Status {
-		NO_RESULT,
-		OK,
-		CLASS_NOT_FOUND_EXCEPTION,
-		ILLEGAL_ACCESS_EXCEPTION,
-		INSTANTIATION_EXCEPTION,
-		MALFORMED_URL_EXCEPTION,
-		IO_EXCEPTION,
-		INVALID_ACTION,
-		JSON_EXCEPTION,
-		ERROR
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/file/EncodingException.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/file/EncodingException.java b/framework/src/com/phonegap/file/EncodingException.java
deleted file mode 100644
index b50037e..0000000
--- a/framework/src/com/phonegap/file/EncodingException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-
-package com.phonegap.file;
-
-public class EncodingException extends Exception {
-
-	public EncodingException(String message) {
-		super(message);
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/664a061d/framework/src/com/phonegap/file/FileExistsException.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/file/FileExistsException.java b/framework/src/com/phonegap/file/FileExistsException.java
deleted file mode 100644
index 676ead1..0000000
--- a/framework/src/com/phonegap/file/FileExistsException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-
-package com.phonegap.file;
-
-public class FileExistsException extends Exception {
-
-	public FileExistsException(String msg) {
-		super(msg);
-	}
-
-}


Mime
View raw message