1.新建libs和assets/www;
2,拷贝cordova-1.6.0.js 到assets/www;拷贝cordova-1.6.0.jar到libs;拷贝xml文件夹到/res目录下
xml文件夹就是\phonegap-phonegap-1.6.1-0-gb4e695d\phonegap-phonegap-b4e695d\lib\android
3、单击/libs文件夹右键,到Build Paths/,到Configure Build Path,点击Libraries,按Add Jar按钮,增加cordova-1.6.0.jar ,按F5更新工程
4、打开/src下的jar文件,添加import org.apache.cordova.*,改 Activity
为 DroidGap,替换setContentView()
为super.loadUrl("file:///android_asset/www/index.html");
5、右键点击AndroidManifest.xml文件,选择Open With > Text Editor(打开方式->文本编辑器),增加如下内容
<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.READ_PHONE_STATE" />
<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.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" />
向activity标记中添加android:configChanges="orientation|keyboardHidden”
最后运行即可;
这里相对新的就是import的内容发生了变化,而且还要导入xml文件,其他的变化不大
这是官方的文档
http://docs.phonegap.com/en/1.6.1/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android