Android phonegap_2.8.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 the src  folder in Eclipse, as shown in           Figure 2-6: 

        Change the class’s extend from  Activity  to  DroidGap .
        Replace the setContentView() line with super.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-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” />

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


show the result:


  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值