Install and configure eclipse, Android SDK, and ADT.
1. Go to the eclipse interface and create an android Project New> Android Project
2. Create two documents/libs and/assets/WWW under the project directory
3. Copy the cordova-1.7.0.js under the android directory in phonegap to/assets/WWW,
Copy the cordova-1.7.0.jar in the same directory to/libs
4. Copy the XML folder in the android directory of phonegap to/Res.
5. The default project of Android is for native apps. Therefore, if you want to use a web app (Cordova), you must modify its reference file.
5.1 reference loading cordova-1.7.0.jar, this time you can press F5 to refresh the project.
5.2 remove import Android. App. Activity; add import org. Apache. Cordova .*;
5.3 modify the Java file in the SRC file and change the activity of class extends to droidgap.
5.4 set setcontentview () line with super. loadurl ("file: // android_asset/www/index.html ");
6. Open androidmanifest. xml and copy
<Supports-screens Android: largescreens = "true" Android: normalscreens = "true" Android: smallscreens = "true" Android: resizeable = "true" Android: anydensity = "true"/>
<Uses-Permission Android: Name = "android. Permission. Camera"/>
<Uses-Permission Android: Name = "android. Permission. Vibrate"/>
<Uses-Permission Android: Name = "android. Permission. access_coarse_location"/>
<Uses-Permission Android: Name = "android. Permission. access_fine_location"/>
<Uses-Permission Android: Name = "android. Permission. access_location_extra_commands"/>
<Uses-Permission Android: Name = "android. Permission. Internet"/>
<Uses-Permission Android: Name = "android. Permission. receive_sms"/>
<Uses-Permission Android: Name = "android. Permission. record_audio"/>
<Uses-Permission Android: Name = "android. Permission. record_video"/>
<Uses-Permission Android: Name = "android. Permission. modify_audio_settings"/>
<Uses-Permission Android: Name = "android. Permission. read_contacts"/>
<Uses-Permission Android: Name = "android. Permission. write_contacts"/>
<Uses-Permission Android: Name = "android. Permission. write_external_storage"/>
<Uses-Permission Android: Name = "android. Permission. access_network_state"/>
<Uses-Permission Android: Name = "android. Permission. get_accounts"/>
<Uses-Permission Android: Name = "android. Permission. broadcast_sticky"/>
To uses-SDK and application.
Source code and configuration file: http://download.csdn.net/detail/xiaogezq0/4972494