phonegap3.1.0自学笔记02_添加插件

在phonegap的官网上写的是按照如下的方式去添加插件:

cordova plugin add org.apache.cordova.device

但是我试了好几次都没有成功,可能是本人水平有限吧,如果哪位能够解释一下,十分感谢。

使用这种方式不能够添加插件,所以我就又回到了原来添加插件的方式。原来添加插件的方式需要先安装git,安装的时候应该有一个选项是将git的命令添加到当前的环境变量中,安装的时候一定要选这个,否则下面的命令无法使用。另外一个要求就是添加插件的时候,需要联网,因为这些东西都是从网上去下载的。

我们添加了一个插件,会在工程目录中的platforms目录下生成插件对应的目录。

下面是列出的添加插件的命令:

设备基本信息

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

  Network Connection and Battery Events:
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 playback and Capture:
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 (File API):
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

   Notification 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

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

   Open new browser windows (InAppBrowser):
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

水平有限,大侠不要拍砖。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值