S
S
starwars9isgreatlol2020-08-05 09:42:53
JavaScript
starwars9isgreatlol, 2020-08-05 09:42:53

Is it possible to make the android version of cordova plugin listen on a specific port and respond on http?

Hello, is anyone familiar with cordova?
There is a cordova plugin from which there are no sources and which has only a version for android in java
I want to run this plugin in the browser

The plugin itself is contained in a .aar archive, inside which there are classes.jar
Plus there is an interface to it that uses various android features, like this

import com.megacorp.mPlugin.sdk.MPlugin;
import org.apache.cordova.CordovaWebView;
public class MPluginV extends CordovaPlugin {

    private Context getApplicationContext() {
        return this.webView.getContext();
    }
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
        super.initialize(cordova, webView);

        mPlugin = new MPlugin(getApplicationContext());
    }


What do you think, is it possible to hook this plugin to some kind of java server that will listen to the port and respond via http
And redefine javascript cordova.exec so that it would send an ajax request to this server?
Perhaps there are some solutions or other options?

All this will not be in production, so you can do any kind of crutches, as long as it works

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question