cordova 插件_Apache Cordova插件

cordova 插件

Plugina allow applications developed with Cordova to access the device's functionality. Plugins are written in JavaScript and native libraries. All the cordova main features are implemented as plugins. If we don't use plugin then we can't use any of the native features.

Plugina允许使用Cordova开发的应用程序访问设备的功能。 插件是用JavaScript和本机库编写的。 Cordova的所有主要功能均作为插件实现。 如果我们不使用插件,那么我们将无法使用任何本机功能。

Corodova:我们为什么使用插件? (Corodova: Why we use plugin?)

Let us suppose you want to access Gallery or Contacts of the device, in such a situation we need plugins, which will communicate with device and request device to grant the required permission.

让我们假设您要访问设备的库或联系人,在这种情况下,我们需要插件,插件将与设备通信并请求设备授予所需的权限。

NOTE: You can also create your own plugin.

注意:您也可以创建自己的插件。

For example:

例如:

Suppose you want to pick a contact from the contact list, then how will you do this through your app, so here we need plugin which communicate with native feature of device and request to grant permission.

假设您要从联系人列表中选择一个联系人,然后如何通过您的应用程序执行此操作,因此在这里我们需要与设备的本机功能通信并请求授予权限的插件。

Like, if you want a mango from tree, but tree is not yours, then what you do, you first ask the owner of the tree, if he grants permission then only you can pick the mango, but if he dowsn't allow you, then you can't go ahead and pick the mango. In the same way plugin ask for permission and also provides a way to act on the permissions.

例如,如果您要从树中取芒果,但树不是您的芒果,那么您要做什么,您首先要询问树的所有者,如果他授予许可,那么您只能采摘芒果,但是如果他不允许您这样做,那么您将无法继续选择芒果。 以相同的方式,插件请求权限,还提供了一种对权限进行操作的方法。

Cordova:插件类型 (Cordova: Types of Plugins)

There are many types of plugin, some are:

插件的类型很多,其中一些是:

  1. Camera Plugin (To open camera)

    相机插件(打开相机)

  2. Geoloation Plugin (It captures your location cordinates → latitude, longitude)

    Geoloation插件(它捕获您的位置坐标→纬度,经度)

  3. File Transfer Plugin (It transfers the file from your storage to somewhere else → say to the server)

    文件传输插件(它将文件从存储设备传输到其他地方→说到服务器)

  4. Contact List Plugin

    联系人列表插件

  5. Push Notification Plugin

    推送通知插件

翻译自: https://www.studytonight.com/apache-cordova/plugin

cordova 插件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值