Merge branch 'master' of github.com:callback/callback-android

This commit is contained in:
Joe Bowser 2011-11-02 13:10:50 -07:00
commit 7244a5a727
10 changed files with 35 additions and 26 deletions

22
README.md Normal file → Executable file
View File

@ -1,7 +1,7 @@
PhoneGap/Android PhoneGap Android
=== ===
PhoneGap/Android is an Android application library that allows for PhoneGap based projects to be built for the Android Platform. PhoneGap based applications are, at the core, an application written with web technology: HTML, CSS and JavaScript. PhoneGap Android is an Android application library that allows for PhoneGap based projects to be built for the Android Platform. PhoneGap based applications are, at the core, an application written with web technology: HTML, CSS and JavaScript.
Requires Requires
--- ---
@ -10,21 +10,21 @@ Requires
- Apache ANT - Apache ANT
- Android SDK [http://developer.android.com](http://developer.android.com) - Android SDK [http://developer.android.com](http://developer.android.com)
PhoneGap/Android Developer Tools PhoneGap Android Developer Tools
--- ---
The PhoneGap developer tooling is split between general tooling and project level tooling. The PhoneGap developer tooling is split between general tooling and project level tooling.
Commands General Commands
./bin/create [path package activity] ... create the ./exmaple app or a phonegap/android project ./bin/create [path package activity] ... create the ./example app or a phonegap android project
./bin/bench ............................ generate a bench proj ./bin/bench ............................ generate a bench proj
./bin/autotest ......................... test the cli tools ./bin/autotest ......................... test the cli tools
./bin/test ............................. run mobile-spec ./bin/test ............................. run mobile-spec
Project Commands Project Commands
These commands live in a generated PhoneGap/Android project. These commands live in a generated PhoneGap Android project.
./phonegap/debug [path] ..................... install to first device ./phonegap/debug [path] ..................... install to first device
./phonegap/emulate .......................... start avd (emulator) named default ./phonegap/emulate .......................... start avd (emulator) named default
@ -37,7 +37,7 @@ Start avd (emulator) named `default`:
./bin/emulate ./bin/emulate
Create the exmaple project and build it to the first device: Create the example project and build it to the first device:
./bin/create ./bin/create
cd example cd example
@ -47,15 +47,17 @@ Start adb logcat (console.log calls output here):
./phonegap/log ./phonegap/log
Running the [phonegap/mobile-spec](http://github.com/phonegap/mobile-spec) tests: Running the [callback/callback-test](http://github.com/callback/callback-test) tests:
---
./bin/test ./bin/test
Create a new PhoneGap/Android Project Creating a new PhoneGap Android Project
---
./bin/create ~/Desktop/myapp com.phonegap.special MyApp ./bin/create ~/Desktop/myapp com.phonegap.special MyApp
Importing a PhoneGap/Android Project into Eclipse Importing a PhoneGap Android Project into Eclipse
---- ----
1. File > New > Project... 1. File > New > Project...

View File

@ -1 +1 @@
1.1.0 1.2.0

View File

@ -17,7 +17,7 @@ MANIFEST_PATH=./AndroidManifest.xml
android create project --target $TARGET --path . --package $PACKAGE --activity $ACTIVITY android create project --target $TARGET --path . --package $PACKAGE --activity $ACTIVITY
# copy all the phonegap scripts etc in there # copy all the phonegap scripts etc in there
cp -R ./phonegap/templates/project/ . cp -R ./phonegap/templates/project/* .
# copy in phonegap.js # copy in phonegap.js
cp ./.phonegap/android/phonegap-$VERSION.js ./assets/www cp ./.phonegap/android/phonegap-$VERSION.js ./assets/www
@ -29,8 +29,8 @@ cp ./.phonegap/android/phonegap-$VERSION.jar ./libs
cat ./phonegap/templates/Activity.java > $ACTIVITY_PATH cat ./phonegap/templates/Activity.java > $ACTIVITY_PATH
# interpolate the acivity name and package # interpolate the acivity name and package
find "$ACTIVITY_PATH" | xargs grep '__ACTIVITY__' -sl | xargs -L1 sed -i "" "s/__ACTIVITY__/${ACTIVITY}/g" find "$ACTIVITY_PATH" | xargs grep '__ACTIVITY__' -sl | xargs -L1 sed -i -e "s/__ACTIVITY__/${ACTIVITY}/g"
find "$ACTIVITY_PATH" | xargs grep '__ID__' -sl | xargs -L1 sed -i "" "s/__ID__/${PACKAGE}/g" find "$ACTIVITY_PATH" | xargs grep '__ID__' -sl | xargs -L1 sed -i -e "s/__ID__/${PACKAGE}/g"
find "$MANIFEST_PATH" | xargs grep '__ACTIVITY__' -sl | xargs -L1 sed -i "" "s/__ACTIVITY__/${ACTIVITY}/g" find "$MANIFEST_PATH" | xargs grep '__ACTIVITY__' -sl | xargs -L1 sed -i -e "s/__ACTIVITY__/${ACTIVITY}/g"
find "$MANIFEST_PATH" | xargs grep '__PACKAGE__' -sl | xargs -L1 sed -i "" "s/__PACKAGE__/${PACKAGE}/g" find "$MANIFEST_PATH" | xargs grep '__PACKAGE__' -sl | xargs -L1 sed -i -e "s/__PACKAGE__/${PACKAGE}/g"

View File

@ -5,7 +5,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title> <title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8"> <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.js"></script> <script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script> <script type="text/javascript" charset="utf-8" src="main.js"></script>
</head> </head>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<phonegap>
<access origin="http://127.0.0.1*"/>
<log level="DEBUG"/>
</phonegap>

View File

@ -4,7 +4,7 @@ set -e
VERSION=$(cat ./VERSION) VERSION=$(cat ./VERSION)
# get the latest mobile-spec # get the latest mobile-spec
git clone git@github.com:phonegap/mobile-spec.git git clone git@github.com:callback/callback-test.git
# clobber test if it exists # clobber test if it exists
if [ -e ./test ] if [ -e ./test ]
@ -17,7 +17,10 @@ fi
# kill the default app and replace it w/ mobile-spec # kill the default app and replace it w/ mobile-spec
rm -rf ./test/assets/www rm -rf ./test/assets/www
mv ./mobile-spec ./test/assets/www mv ./callback-test ./test/assets/www
# copy in phonegap.js since www dir was replaced above
cp ./framework/assets/www/phonegap-$VERSION.js ./test/assets/www/phonegap-$VERSION.js
# build it, launch it and start logging on stdout # build it, launch it and start logging on stdout
cd ./test && ./bin/debug && ./bin/log cd ./test && ./phonegap/debug && ./phonegap/log

View File

@ -17,6 +17,8 @@
* under the License. * under the License.
*/ */
// Version 1.2.0
if (typeof PhoneGap === "undefined") { if (typeof PhoneGap === "undefined") {
/** /**
@ -387,9 +389,6 @@ PhoneGap.Channel.join(function() {
prompt("", "gap_init:"); prompt("", "gap_init:");
PhoneGap.onDeviceReady.fire(); PhoneGap.onDeviceReady.fire();
// Fire the onresume event, since first one happens before JavaScript is loaded
PhoneGap.onResume.fire();
}, PhoneGap.deviceReadyChannelsArray); }, PhoneGap.deviceReadyChannelsArray);
}, [ PhoneGap.onDOMContentLoaded, PhoneGap.onNativeReady ]); }, [ PhoneGap.onDOMContentLoaded, PhoneGap.onNativeReady ]);
@ -933,7 +932,7 @@ PhoneGap.JSCallback = function() {
// If server is stopping // If server is stopping
else if (xmlhttp.status === 503) { else if (xmlhttp.status === 503) {
console.log("JSCallback Error: Service unavailable. Stopping callbacks."); console.log("JSCallback Server Closed: Stopping callbacks.");
} }
// If request wasn't GET // If request wasn't GET

View File

@ -1,7 +1,7 @@
<html> <html>
<head> <head>
<title></title> <title></title>
<script src="phonegap-1.1.0.js"></script> <script src="phonegap-1.2.0.js"></script>
</head> </head>
<body> <body>

2
framework/src/com/phonegap/Device.java Normal file → Executable file
View File

@ -29,7 +29,7 @@ import android.provider.Settings;
public class Device extends Plugin { public class Device extends Plugin {
public static String phonegapVersion = "1.1.0"; // PhoneGap version public static String phonegapVersion = "1.2.0"; // PhoneGap version
public static String platform = "Android"; // Device OS public static String platform = "Android"; // Device OS
public static String uuid; // Device UUID public static String uuid; // Device UUID