你好,游客 登录 注册 搜索
背景:
阅读新闻

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

[日期:2013-07-20] 来源:oschina.net  作者:Linux [字体:大 中 小]

今天在 PhoneGap Day 会议上 PhoneGap 发布了 3.0 版本,该版本对底层架构进行了全面显著的改进,还包括其他方面的改进。

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

Adobe PhoneGap 3.0 Released
What's New in Cordova iOS 3
Introducing Cordova 3 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

PhoneGap 的详细介绍:请点这里
PhoneGap 的下载地址:请点这里

via raymondcamden/oschina编译

linux
相关资讯       PhoneGap 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款