Reputation: 21
Preface
I have an android app that was already prebuilt but I later decided I wanted to add Cordova functionality by embedding it in the webviews. I was able to accomplish this by following the instructions here on the Cordova official documentation (made the jar, applied it to my view, ect)
This works fine and dandy if I simply download the plugins and manage them manually I.E. manually move the java and js files over to my project following the proper project structure AND manually editing the config.xml and cordova_plugins.js files.
The Problem
I want to take all the manual work out of the equation when adding a new plugin. I am looking for a way to have the simplicity of "cordova plugin install" but I cannot utilize this tool because my project "is not a Cordova project." I did not set it up using Cordova but instead just added the lib jar to my project.
What I have tried
Cordova package management tools - Not a option. "Not a Cordova project"
NPM - Pulls everything but also doesn't handle the configuration changes.
Plugman - Works! BUT it is installing the whole plugin library into my project including all the other platforms (blackberry, ios, ect) code that I do not want. I understand that these libs also contain config information for the plugins, but this does simply causes my app size to be huge and adds a bunch of unneeded files.
Example of plugman command:
plugman install --platform android --project project/path/ofManifest --plugin cordova-plugin-camera
As you can see I do provide the platform and it does plug into the app properly but the original plugin library all sticks around as well.
For all of the above I actually setup a package json and have npm fire off post install js scripts. When finished it will then go use npm/cordova/plugman to install the plugins I need.
Note - I have not tried ionic because I cannot get past the firewall with the download
The question
Is there a way to just install the android-only version of a plugin including the auto configuration modifications that the other tools already do without adding a bunch of other noise the the plugin provides? I have looked around google and stack and plugman is the general answer but as state in my write up, it is including other platform lib code that I do not want in my apk.
Upvotes: 1
Views: 52