Fahad Ali
Fahad Ali

Reputation: 124

How to use existing android app as cordova plugin

I have build an android app with help of quasar and cordova.

Now I want to add print function that is actually device specific (e.g. mpos device).

I have uploaded the source code of native android project that i want to use in my cordova project repo of android source code.

I want to call printText function into cordova-plugin from native android link to printText function

something similar like below:

exports.print= function (arg0, success, error) {
  exec(success, error, 'PrintDevActivity', 'printText', [arg0]);
}

I need help in these two things:

  1. how many files i need to copy from above repo of android project to my cordova plugin

  2. what changes i need to do in cordova plugin plugin.xml so it will work.

I am confused , should i need to copy only .java files or also gradle etc.

This is my plugin.xml file of cordova plugin

plugin.xml

Any help or suggestion will highly appreciated.

Thank you

Upvotes: 0

Views: 722

Answers (2)

faddy brother
faddy brother

Reputation: 26

As per your question, I think you need to build cordova plugin for any android sdk. Please check below link, i think this is have lot of information about building cordova plugin with any existing sdk or code.

building-a-cordova-plugin-for-your-native-sdk

I hope this will help you. Thanks

Upvotes: 1

Norman Nuthu
Norman Nuthu

Reputation: 84

follow this guide Upgrading Android Apache Cordova and it'll help you in part 1 of updating your config.xml file. Their Documentation is pretty simple to follow along.

Upvotes: 0

Related Questions