A5下载文章资讯

分类分类

PhoneGap 3.0 发布,使用全新的插件架构

2013-07-23 10:31作者:qazwsxzxc

今天在 PhoneGap Day (http://pgday.phonegap.com/us2013/)会议上 PhoneGap 发布了 3.0 版本,该版本对底层架构进行了全面显著的改进,还包括其他方面的改进。

首先,你可以先阅读以下链接:

Adobe PhoneGap 3.0 Released:http://phonegap.com/blog/2013/07/19/adobe-phonegap-3.0-released/

What's New in Cordova iOS 3:http://shazronatadobe.wordpress.com/2013/07/19/whats-new-in-cordova-ios-3-0-0/

Introducing Cordova 3 for Android:http://www.infil00p.org/introducing-cordova-3-0-0-for-android/

其次,有一个新的命令行工具你将会使用到(不过 cordova-cli 还可以继续使用),它就是 phonegap,可使用如下命令行来安装该工具:

sudo npm install -g phonegap

很明显 phonegap 命令行工具与 cordova 命令行工具有所不同。最大的不同是新的 phonegap 命令行工具完全支持 PhoneGap Build。其次是可快速的检查 SDK/platforms :

 

我想 PhoneGap 3.0 最需要关注的是完全的插件体系结构,所有的功能特性包括摄像头等都是使用插件方式提供。也就是说新建项目后很多功能是无法使用的,你必须将其对应的插件添加到项目中。

例如在 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 项目时你要先考虑项目需要什么功能,然后通过命令行来添加这些功能。

下面是完整的插件列表,我直接拷贝过来,可能会有变化:

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

Network and battery status:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-battery-status.git

Accelerometer, compass, and geolocation:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion.git
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation.git
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git

Camera, media capture, and media playback:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git

Access files on device or network:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git

Notifications via dialog box or vibration:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git

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

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

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

In-app browser:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

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

via raymondcamden/oschina编译

PhoneGap 手机应用开发平台下载地址http://down.admin5.com/jsp/84951.html

展开全部

相关

说两句网友评论
    我要跟贴
    取消