cordova-android/README.md

86 lines
2.7 KiB
Markdown
Raw Normal View History

Cordova Android
2011-08-19 09:21:51 +08:00
===
Cordova Android is an Android application library that allows for Cordova based projects to be built for the Android Platform. Cordova based applications are, at the core, an application written with web technology: HTML, CSS and JavaScript.
Apache Cordova is an effort undergoing incubation at The Apache
2012-01-06 04:39:18 +08:00
Software Foundation (ASF), sponsored by the Apache Incubator project.
Incubation is required of all newly accepted projects until a further
review indicates that the infrastructure, communications, and decision
making process have stabilized in a manner consistent with other
successful ASF projects. While incubation status is not necessarily
a reflection of the completeness or stability of the code, it does
indicate that the project has yet to be fully endorsed by the ASF.
2009-11-25 07:11:32 +08:00
2011-08-20 13:20:53 +08:00
Requires
2011-08-19 09:21:51 +08:00
---
2010-01-28 07:00:21 +08:00
- Java JDK 1.5
- Apache ANT
2011-08-20 13:20:53 +08:00
- Android SDK [http://developer.android.com](http://developer.android.com)
2010-09-01 04:27:43 +08:00
Cordova Android Developer Tools
2011-08-19 09:21:51 +08:00
---
The Cordova developer tooling is split between general tooling and project level tooling.
2011-09-02 05:44:02 +08:00
2011-11-01 10:14:05 +08:00
General Commands
2010-08-31 07:02:47 +08:00
./bin/create [path package activity] ... create the ./example app or a cordova android project
2011-09-02 05:44:02 +08:00
./bin/bench ............................ generate a bench proj
./bin/autotest ......................... test the cli tools
2011-08-19 09:31:13 +08:00
./bin/test ............................. run mobile-spec
2011-09-02 05:44:02 +08:00
Project Commands
These commands live in a generated Cordova Android project.
2011-09-02 05:44:02 +08:00
./phonegap/debug [path] ..................... install to first device
./phonegap/emulate .......................... start avd (emulator) named default
./phonegap/log .............................. starts logcat
2011-08-19 09:31:13 +08:00
Running the Example Project
2011-08-20 13:20:53 +08:00
---
Start avd (emulator) named `default`:
2011-08-19 09:31:13 +08:00
2011-08-19 09:21:51 +08:00
./bin/emulate
2010-08-31 07:02:47 +08:00
2011-11-01 10:14:05 +08:00
Create the example project and build it to the first device:
2011-08-20 13:20:53 +08:00
./bin/create
2011-09-02 05:44:02 +08:00
cd example
./phonegap/debug
2011-08-20 13:20:53 +08:00
Start adb logcat (console.log calls output here):
2011-08-19 09:31:13 +08:00
2011-09-02 05:44:02 +08:00
./phonegap/log
2009-12-23 08:01:54 +08:00
2011-11-01 10:14:05 +08:00
Running the [callback/callback-test](http://github.com/callback/callback-test) tests:
---
./bin/test
Creating a new Cordova Android Project
2011-11-01 10:14:05 +08:00
---
./bin/create ~/Desktop/myapp com.phonegap.special MyApp
Importing a Cordova Android Project into Eclipse
2011-08-20 13:20:53 +08:00
----
1. File > New > Project...
2. Android > Android Project
2010-08-31 07:02:47 +08:00
3. Create project from existing source (point to the generated app found in tmp/android)
4. Right click on libs/phonegap.jar and add to build path
5. Right click on the project root: Run as > Run Configurations
2010-08-31 07:02:47 +08:00
6. Click on the Target tab and select Manual (this way you can choose the emulator or device to build to)
2011-08-20 13:20:53 +08:00
Further Reading
2010-08-31 07:02:47 +08:00
---
2011-08-20 13:20:53 +08:00
- [http://developer.android.com](http://developer.android.com)
2010-02-15 15:40:35 +08:00
- [http://docs.phonegap.com](http://docs.phonegap.com)
2010-09-01 04:27:43 +08:00
- [http://wiki.phonegap.com](http://wiki.phonegap.com)