Search code examples
androidcordovacordova-plugins

How to create a cordova plugin for my android library?


I have developed an android library using which one can send messages to other android devices. I have developed many demo apps for mobile and watch to demonstrate this using native android projects. Now I want to explore hybrid android development. I want to know how a native android code can access my android library and use the functionalities.

I have come across custom Cordova plugins. Is it possible for me to build a Cordova plugin for my android library? If yes, can I then use it in a hybrid project and access the functionalities? If not, what is the best way to do it? Thanks in advance.


Solution

  • To answer your 2 important questions:

    1. Is it possible for me to build a Cordova plugin for my android library?

    Yes, it's possible to create a custom Cordova plugin for your library. That's how all the Cordova plugins are dependent on the base Android library.

    2. can I then use it in a hybrid project and access the functionalities?

    Yes, you can.

    Some are the links that might be helpful to create a new custom Cordova plugin.