Compare commits

...

17 Commits

Author SHA1 Message Date
Joe Bowser f4da7e164d Incrementing project to 1.7.0rc1 2012-04-23 11:37:33 -07:00
macdonst 05192a91da Removing un-needed logs 2012-04-19 21:03:55 -04:00
Fil Maj 3835144b93 [CB-473] run ant clean before ant debug install 2012-04-19 17:25:19 -07:00
Joe Bowser bdf452b02a Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-cordova-android 2012-04-19 16:48:32 -07:00
Joe Bowser bcc2957f20 Fix for CB-549 2012-04-19 16:45:15 -07:00
Fil Maj 81059b398f Proper fix for CB-164. Online/offline events now propagated to webview properly 2012-04-19 16:35:55 -07:00
Fil Maj 31d5a94ea9 [CB-164] Changed network plugin to sync from async and removed setKeepCallback(true) on plugin result in there. Fixes location.reload() not firing deviceready due to network plugin being unresponsive 2012-04-19 12:33:45 -07:00
Joe Bowser 1e5457a47d Reverting the back button change that I made, for some reason certain methods aren't inherited when you extend DroidGap 2012-04-19 12:22:33 -07:00
macdonst 7b75e2f1b0 CB-539: FileTransfer.download fails when target starts with 'file://' 2012-04-18 13:56:29 -04:00
Joe Bowser 180696baec Fixed back button behaviour. WIN 2012-04-17 17:50:07 -07:00
Joe Bowser 76820ebaff CB-480 work, back button and history issues are preventing this from being tested properly 2012-04-17 17:13:33 -07:00
Joe Bowser c341cf0d47 Adding fix for CB-482 2012-04-17 12:20:23 -07:00
macdonst f2c38ea0a7 Automatically update index.html in templates directory on version change 2012-04-13 16:36:46 -04:00
Joe Bowser 0772a315c4 CB-489 - Adding .js to the example, thought it was removed for a reason 2012-04-13 13:08:13 -07:00
macdonst 08d7a9c87a Remove duplicate files from repository
We should only have these files in one place in the repo. Changes have been made to the scripts to pick up the xml files from their proper location.
2012-04-13 15:35:49 -04:00
Joe Bowser eb48055acd Getting setup to tag 1.6.1 2012-04-12 16:37:27 -07:00
Joe Bowser e4a52de0a5 Copying new XML into the templates for 1.6.1. Turns out tags are broken 2012-04-12 14:33:29 -07:00
15 changed files with 244 additions and 284 deletions
+1 -1
View File
@@ -1 +1 @@
1.6.0
1.7.0rc1
+4
View File
@@ -34,6 +34,10 @@ cp ./framework/assets/www/cordova-$VERSION.js $PROJECT_PATH/.cordova/android/cor
# copy in cordova.jar
cp ./framework/cordova-$VERSION.jar $PROJECT_PATH/.cordova/android/cordova-$VERSION.jar
# copy in res/xml
cp ./framework/res/xml/cordova.xml $PROJECT_PATH/.cordova/android/cordova.xml
cp ./framework/res/xml/plugins.xml $PROJECT_PATH/.cordova/android/plugins.xml
# app properties
cat > $PROJECT_PATH/.cordova/config <<eom
VERSION=$VERSION
+5
View File
@@ -25,6 +25,11 @@ cp ./.cordova/android/cordova-$VERSION.js ./assets/www
# copy in cordova.jar
cp ./.cordova/android/cordova-$VERSION.jar ./libs
# copy in res/xml
mkdir ./res/xml
cp ./.cordova/android/cordova.xml ./res/xml
cp ./.cordova/android/plugins.xml ./res/xml
# copy in default activity
cat ./cordova/templates/Activity.java > $ACTIVITY_PATH
+1 -1
View File
@@ -4,6 +4,6 @@
# if there are no devices listed then emulate
ant clean
ant debug install
adb shell am start -n $PACKAGE/$PACKAGE.$ACTIVITY
@@ -4,9 +4,9 @@
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" charset="utf-8" src="cordova-1.6.0"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" charset="utf-8" src="cordova-1.7.0rc1.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
<body onload="init();" id="stage" class="theme">
@@ -25,14 +25,14 @@
</dl>
<a href="#" class="btn large" onclick="toggleAccel();">Toggle Accelerometer</a>
<a href="#" class="btn large" onclick="getLocation();">Get Location</a>
<a href="tel:411" class="btn large">Call 411</a>
<a href="tel:411" class="btn large">Call 411</a>
<a href="#" class="btn large" onclick="beep();">Beep</a>
<a href="#" class="btn large" onclick="vibrate();">Vibrate</a>
<a href="#" class="btn large" onclick="show_pic();">Get a Picture</a>
<a href="#" class="btn large" onclick="get_contacts();return false;">Get Phone's Contacts</a>
<a href="#" class="btn large" onclick="check_network();return false;">Check Network</a>
<dl>
<dt>Compass Heading:</dt><dd id="h">Off</dd>
<dt>Compass Heading:</dt><dd id="h">Off</dd>
</dl>
<a href="#" class="btn large" onclick="toggleCompass();return false;">Toggle Compass</a>
<div id="viewport" class="viewport" style="display: none;">
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<cordova>
<access origin="http://127.0.0.1*"/>
<log level="DEBUG"/>
</cordova>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
<plugin name="Device" value="org.apache.cordova.Device"/>
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
<plugin name="File" value="org.apache.cordova.FileUtils"/>
<plugin name="Network Status" value="org.apache.cordova.NetworkManager"/>
<plugin name="Notification" value="org.apache.cordova.Notification"/>
<plugin name="Storage" value="org.apache.cordova.Storage"/>
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
</plugins>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -19,7 +19,7 @@
<html>
<head>
<title></title>
<script src="cordova-1.6.0.js"></script>
<script src="cordova-1.7.0rc1.js"></script>
</head>
<body>
+1
View File
@@ -122,6 +122,7 @@
<!-- update project files to reference cordova-x.x.x.min.js -->
<replaceregexp match="cordova(.*)\.js" replace="cordova-${version}.js" byline="true">
<fileset file="assets/www/index.html" />
<fileset file="../bin/templates/project/cordova/templates/project/assets/www/index.html" />
</replaceregexp>
<!-- This is sketchy, but it works, ${dblQuote} does not -->
+1 -1
View File
@@ -38,7 +38,7 @@ import android.telephony.TelephonyManager;
public class Device extends Plugin {
public static final String TAG = "Device";
public static String cordovaVersion = "1.6.0"; // Cordova version
public static String cordovaVersion = "1.7.0rc1"; // Cordova version
public static String platform = "Android"; // Device OS
public static String uuid; // Device UUID
@@ -48,6 +48,7 @@ import android.graphics.Color;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
import android.view.Menu;
@@ -1072,7 +1073,7 @@ public class DroidGap extends Activity implements CordovaInterface {
}
/**
* Called when a key is pressed.
* Called when a key is de-pressed. (Key UP)
*
* @param keyCode
* @param event
@@ -1085,21 +1086,16 @@ public class DroidGap extends Activity implements CordovaInterface {
// If back key
if (keyCode == KeyEvent.KEYCODE_BACK) {
// If back key is bound, then send event to JavaScript
if (this.bound) {
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');");
return true;
}
// If not bound
else {
} else {
// If not bound
// Go to previous page in webview if it is possible to go back
if (this.backHistory()) {
return true;
}
// If not, then invoke behavior of super class
else {
this.activityState = ACTIVITY_EXITING;
@@ -410,7 +410,7 @@ public class FileTransfer extends Plugin {
*/
public JSONObject download(String source, String target) throws IOException {
try {
File file = new File(target);
File file = getFileFromPath(target);
// create needed directories
file.getParentFile().mkdirs();
@@ -421,6 +421,14 @@ public class FileTransfer extends Plugin {
URL url = new URL(source);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
//Add cookie support
String cookie = CookieManager.getInstance().getCookie(source);
if(cookie != null)
{
connection.setRequestProperty("cookie", cookie);
}
connection.connect();
Log.d(LOG_TAG, "Download file:" + url);
@@ -480,4 +488,17 @@ public class FileTransfer extends Plugin {
}
}
/**
* Get a File object from the passed in path
*
* @param path
* @return
*/
private File getFileFromPath(String path) {
if (path.startsWith("file://")) {
return new File(path.substring(7));
} else {
return new File(path);
}
}
}
@@ -58,7 +58,7 @@ public class NetworkManager extends Plugin {
public static final String LTE = "lte";
public static final String UMB = "umb";
public static final String HSPA_PLUS = "hspa+";
// return types
// return type
public static final String TYPE_UNKNOWN = "unknown";
public static final String TYPE_ETHERNET = "ethernet";
public static final String TYPE_WIFI = "wifi";
@@ -89,7 +89,7 @@ public class NetworkManager extends Plugin {
*/
public void setContext(CordovaInterface ctx) {
super.setContext(ctx);
this.sockMan = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
this.sockMan = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
this.connectionCallbackId = null;
// We need to listen to connectivity events to update navigator.connection
@@ -98,7 +98,7 @@ public class NetworkManager extends Plugin {
if (this.receiver == null) {
this.receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
public void onReceive(Context context, Intent intent) {
updateConnectionInfo((NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO));
}
};
@@ -117,7 +117,7 @@ public class NetworkManager extends Plugin {
*/
public PluginResult execute(String action, JSONArray args, String callbackId) {
PluginResult.Status status = PluginResult.Status.INVALID_ACTION;
String result = "Unsupported Operation: " + action;
String result = "Unsupported Operation: " + action;
if (action.equals("getConnectionInfo")) {
this.connectionCallbackId = callbackId;
@@ -137,8 +137,7 @@ public class NetworkManager extends Plugin {
* @return T=returns value
*/
public boolean isSynch(String action) {
// All methods take a while, so always use async
return false;
return true;
}
/**
@@ -182,7 +181,7 @@ public class NetworkManager extends Plugin {
// If we are not connected to any network set type to none
if (!info.isConnected()) {
type = TYPE_NONE;
}
}
else {
type = getType(info);
}
@@ -212,7 +211,7 @@ public class NetworkManager extends Plugin {
*/
private String getType(NetworkInfo info) {
if (info != null) {
String type = info.getTypeName();
String type = info.getTypeName();
if (type.toLowerCase().equals(WIFI)) {
return TYPE_WIFI;
@@ -233,7 +233,7 @@ public class Notification extends Plugin {
// First button
if (fButtons.length > 0) {
dlg.setPositiveButton(fButtons[0],
dlg.setNegativeButton(fButtons[0],
new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
@@ -255,7 +255,7 @@ public class Notification extends Plugin {
// Third button
if (fButtons.length > 2) {
dlg.setNegativeButton(fButtons[2],
dlg.setPositiveButton(fButtons[2],
new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();