免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
PhoneGap 3.0 安裝

3.0是通過nodejs安裝的,不像以前的版本有安裝包

  1. 下載nodejs
  2. 在環(huán)境變量里看是否配置了nodejs,然后在cmd轉(zhuǎn)到C盤根目錄下,輸入npm install phonegap. 即安裝phonegap

到此安裝成

設(shè)置系統(tǒng)變量

 系統(tǒng)變量 Path后面添加:

  • D:\Program Files\ADT\sdk\tools;
  • D:\Program Files\ADT\sdk\platform-tools;
  • D:\Program Files\ADT\sdk\eclipse\plugins\org.apache.ant_1.8.3.v201301120609\bin配的是ant.bat的變量,四個(gè)都不能少,你對(duì)應(yīng)這配吧
  • C:\Program Files (x86)\Java\jdk1.6.0_10\bin;

 新增 JAVA_HOME,設(shè)置值為java sdk 根目錄:

  C:\Program Files (x86)\Java\jdk1.6.0_10\


下面就構(gòu)建應(yīng)用吧

phonegap create hello com.helloworld.hello helloworld

 第一個(gè)參數(shù)hello表示項(xiàng)目文件夾名,在此文件夾下會(huì)生成www子目錄作為主頁面存入目錄,包括有css,js和img資源。 其中config.xml包括了重要的資源描述和項(xiàng)目配置信息.

   第2個(gè)參數(shù)是可選的,com.vmeitime.hello表示項(xiàng)目包名; 第3個(gè)參數(shù):HelloWord表示顯示的文本;

接下來,添加相應(yīng)平臺(tái)

cd hello 進(jìn)入項(xiàng)目路徑

為項(xiàng)目添加插件,然后再生成不同平臺(tái)下的項(xiàng)目.

添加插件(需要先安裝git工具 https://help.github.com/articles/set-up-git):

   PhoneGap 3.0 最需要關(guān)注的是完全的插件體系結(jié)構(gòu),所有的功能特性包括攝像頭等都是使用插件方式提供。也就是說新建項(xiàng)目后很多功能是無法使用的,你必須將其對(duì)應(yīng)的插件添加到項(xiàng)目中。

   例如在 cordova 中添加插件的方法是:

       cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

   而通過 phonegap 命令行工具的方法是:

       phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

   這意味著在開始 PhoneGap 項(xiàng)目時(shí)你要先考慮項(xiàng)目需要什么功能,然后通過命令行來添加這些功能。

1). 添加的插件都將放在C:\hello\plugins目錄下.

2). 同時(shí)會(huì)在所有平臺(tái)下的config.xml文件中增加feature插件配置,如:C:\hello\platforms\<平臺(tái)>\res\xml\config.xml)

3). 增加相應(yīng)的插件java文件:C:\hello\platforms\android\src

4). 增加相應(yīng)的插件js文件:C:\hello\platforms\android\assets\www\plugins

下面是完整的插件列表,我直接拷貝過來,可能會(huì)有變化:

   Basic device information (Device API):

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

   Network Connection and Battery Events:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-battery-status.git

   Accelerometer, Compass, and Geolocation:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion.git

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation.git

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git

   Camera, Media playback and Capture:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git

   Access files on device or network (File API):

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git

   Notification via dialog box or vibration:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git

   Contacts:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts.git

   Globalization:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization.git

   Splashscreen:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git

   Open new browser windows (InAppBrowser):

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

   Debug console:

       $ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git


運(yùn)行build命令,輸入不同平臺(tái)標(biāo)識(shí),生成不同平臺(tái)下的相應(yīng)文件。如下以android設(shè)備為例:

       c:\hello> phonegap build android

   要查看詳細(xì)(verbose)執(zhí)行過程,可增加命令參數(shù)-V :

       c:\hello> phonegap -V build android

   之后可以看到C:\hello\platforms\android里出現(xiàn)Android項(xiàng)目。



下面你就導(dǎo)入進(jìn)eclipse 編輯吧

是不是比以前創(chuàng)建應(yīng)用方便多了

如果遇到j(luò)ava問題,可能你要換到j(luò)dk1.6

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
用Phonegap開發(fā)一個(gè)豆瓣電臺(tái)(一)
最新Android 4.x 搭建開發(fā)環(huán)境
Google Android操作系統(tǒng)開發(fā)入門教程
ubuntu12.04搭建android開發(fā)環(huán)境 .
phonegap3.4.0 生成PHONEGAP.JAR
MAC下搭建Android Eclipse開發(fā)環(huán)境
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服