Android phonegap_2.8.1开发部署_第1张图片

To install PhoneGap, follow these steps:
1. Open your web browser and point it at www.phonegap.com.
2. Click the Download button on PhoneGap’s navigation bar. (It should be on the far-right margin.)
3. A ZIP fi le should download to your Downloads folder.

4. Double-click the ZIP file to uncompress it. You should see a folder that contains various files and directories.

5. Open the Android folder. You should see a Sample folder, a pair of JavaScript files, and a.jar file, as shown in Figure 2-5.
6. Launch Eclipse, and then, from the File menu, select New ➪ Android Project.
7. In the root directory of the project, create two new directories:

/libs
/assets/www

8. Copy cordova.js from your PhoneGap download earlier to /assets/www.
9. Copy cordova-2.8.1.jar from your PhoneGap download earlier to /libs.
10. Now, you must make the following adjustments to the project’s main Java file found in thesrc folder in Eclipse, as shown in Figure 2-6:

Change the class’s extend from Activity to DroidGap .
Replace the setContentView() line withsuper.loadUrl(“file:///android_asset/www/index.html”);.
Add import com.phonegap.*;.

11. Right-click the AndroidManifest.xml file and select Open

12. Paste the following permissions under versionName:

<supports-screensandroid: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” />

13. You are now also required to have a config.xml file under ./res/xml/config.xml. Thisfile is included in the latest 1.0.0 release.


show the result:

Android phonegap_2.8.1开发部署_第2张图片

更多相关文章

  1. android Gide加载webp图片方法
  2. android避免decodeResource图片时占用太大的内存。
  3. android 图片全屏
  4. Android 图片缩放,手势,事件
  5. Android图片圆角处理
  6. Android如何通过代码将res里的图片转换成drawable.
  7. Android通过图片名字获得ID
  8. android图片上传springMvc
  9. android中图片的拖拉和缩放

随机推荐

  1. android——Bitmap.Config ARGB_8888
  2. android 让TextView自带滚动条
  3. Android(安卓)监听 home键和菜单键
  4. 【Android】在任何View上添加红点★★★
  5. Android(安卓)动态切换底部tab按钮
  6. Android(安卓)7.0 app代码修改抓包
  7. 视频聊天系统源码Android(安卓)播放视频
  8. Android电池管理
  9. Android(安卓)2.2.2到Android(安卓)4.2.2
  10. Android笔记