cordova-android/README.md

87 lines
2.1 KiB
Markdown
Raw Normal View History

2010-01-28 07:00:21 +08:00
PhoneGap/Android
2011-08-19 09:21:51 +08:00
===
2010-01-28 07:00:21 +08:00
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.
2009-11-25 07:11:32 +08:00
2010-08-31 07:02:47 +08:00
Pre Requisites
2011-08-19 09:21:51 +08:00
---
2010-01-28 07:00:21 +08:00
- Java JDK 1.5
2010-08-31 07:02:47 +08:00
- Android SDK [http://developer.android.com](http://developer.android.com)
2010-01-28 07:00:21 +08:00
- Apache ANT
2010-09-01 04:27:43 +08:00
2011-08-19 09:21:51 +08:00
PhoneGap/Android Developer Tools
---
2010-10-07 02:51:42 +08:00
Tools for developers building mobile apps using PhoneGap for Android.
2010-08-31 07:02:47 +08:00
2011-08-19 09:31:13 +08:00
Commands
2010-08-31 07:02:47 +08:00
2011-08-19 09:31:13 +08:00
./bin/create [path package activity] ... create a phonegap/android project
./bin/debug ............................ install to first device
./bin/emulate .......................... start emulator named default
./bin/log .............................. starts logging to stdout
./bin/test ............................. run mobile-spec
Running the Example Project
2011-08-19 09:31:13 +08:00
# start avd (emulator) named 'default'
2011-08-19 09:21:51 +08:00
./bin/emulate
2010-08-31 07:02:47 +08:00
2011-08-19 09:31:13 +08:00
# create the exmaple project and build it to the first device
./bin/create && cd example && ./../bin/debug
# start logging to stdout
./bin/log
2009-12-23 08:01:54 +08:00
Running Mobile-Spec
./bin/test
Create a new PhoneGap/Android Project
./bin/create ~/Desktop/myapp com.phonegap.special MyApp
Importing a PhoneGap/Android app into Eclipse
---------------------------------------------
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-19 09:21:51 +08:00
Common Commandline Tools
===
2010-08-31 07:02:47 +08:00
List devices attached
---
2010-09-06 06:13:32 +08:00
adb devices
2010-08-31 07:02:47 +08:00
Install APK onto device
---
2010-09-06 06:13:32 +08:00
apk -s 0123456789012 install phonegap.apk
2010-08-31 07:02:47 +08:00
Logging
---
Via console.log calls from your apps javascript.
2010-09-06 06:13:32 +08:00
adb logcat
2010-08-31 07:02:47 +08:00
Debugging
---
Attach it to a process on the device
adb jdwp
For more info see
-----------------
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)