How to get a link to cordova plugins in Sencha Touch code

I am going to add some plugins to my cordova project. But the cordova project is being created by Sencha Touch 2.

So, if I add a plugin for the cord,

How to get a link to cordova plugins in Sencha Touch code? (Since Sencha-Touch code is ONE level above the cordova plugin)

And I should not touch the generated Cordova code, because it will be replaced every time I create the cordova project again using Sencha Touch CMD commands.


Update

I would like to clarify my question by specifying a scenario:

For example, I would like to use the camera in Sencha Touch code, but I can access my own resources on my mobile phone using Cordova plugins. And when you run the Sencha Touch command to create a Cordova project, all the code under the cord folder will be overwritten, therefore it cannot perform encoding in the cordova folder, therefore all encoding must be done at the Sencha Touch level.

Thus, the problem becomes-> how can I access the camera in sencha touch code if the plugin is controlled by cordova, which means that access to cordova plugins is beyond Sencha Touch.

To make this clearer, here is the structure of the Sencha Touch project, which contains the Cordova project:

Root folder for Sencha Touch Project
-app
-cordova
  -plugins
-...

as you can see, the plugins are in the cordova folder, so I don’t know how to get the link to the camera plugin, for example:

Ext.navigator.camera.function() (like this?)

Sencha Touch.

, .

.

+4
2

Cordova (, plugin.xml), clobbers, . target deviceready.

plugin.xml clobbers .

0

https://github.com/CaliLuke/NativeContacts/blob/master/app/view/Picture.js

.

/*
 * File: app/view/Picture.js
 *
 * This file was generated by Sencha Architect version 2.0.0.
 * http://www.sencha.com/products/architect/
 *
 * This file requires use of the Sencha Touch 2.0.x library, under independent license.
 * License of Sencha Architect does not include license for Sencha Touch 2.0.x. For more
 * details see http://www.sencha.com/license or contact license@sencha.com.
 *
 * This file will be auto-generated each and everytime you save your project.
 *
 * Do NOT hand edit this file.
 */

Ext.define('Contact.view.Picture', {
    extend: 'Ext.Container',
    alias: 'widget.contactpic',

    config: {
        height: 120,
        minHeight: 100,
        style: 'overflow: hidden',
        ui: '',
        layout: {
            align: 'center',
            type: 'vbox'
        },
        overflow: 'hidden',
        tpl: [
            '<img src="{picture}" width="160" />'
        ],
        items: [
            {
                xtype: 'component',
                html: ''
            },
            {
                xtype: 'button',
                bottom: 5,
                itemId: 'mybutton',
                right: 5,
                iconCls: 'add',
                iconMask: true
            }
        ],
        listeners: [
            {
                fn: 'onMybuttonTap',
                event: 'tap',
                delegate: '#mybutton'
            }
        ]
    },

    onMybuttonTap: function(button, e, options) {
        Ext.device.Camera.capture({
            source: 'camera',
            destination: 'file',

            success: function(url) {
                this.fireEvent('change', this, url);
            },
            failure: function() {
                Ext.Msg.alert('Error', 'There was an error when acquiring the picture.');
            },
            scope: this
        });
    }

});
0

Source: https://habr.com/ru/post/1539955/


All Articles