日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

PhoneGap 3.0 安裝

 rui5327 2014-01-07

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è)都不能少,你對應(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)目文件夾名,在此文件夾下會生成www子目錄作為主頁面存入目錄,包括有css,js和img資源。 其中config.xml包括了重要的資源描述和項(xiàng)目配置信息.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

   Basic device information (Device API):

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

   Network Connection and Battery Events:

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

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

   Accelerometer, Compass, and Geolocation:

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

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

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

   Camera, Media playback and Capture:

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

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

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

   Access files on device or network (File API):

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

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

   Notification via dialog box or vibration:

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

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

   Contacts:

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

   Globalization:

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

   Splashscreen:

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

   Open new browser windows (InAppBrowser):

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

   Debug console:

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


運(yùn)行build命令,輸入不同平臺標(biāo)識,生成不同平臺下的相應(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

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多