build a cordova plugin for android from source code

Mahmoud Farahat

I'm a .Net developer and I've some basic information about java development , I'm developing a multi-device-hybrid-apps using visual studio and cordova.

I use a native plugin for push notifications PushPlugin , I want to do some changes in this plugin using java , i downloaded eclipse and ADT plugin .

actually my problem is in using eclipse not in understanding java code (what is project template in eclipse should i use to create android library ), I've created a new android project and added the PushPlugin code that I downloaded from GitHub , but "android project" is generating an android app not just a jar file to use as a cordova plugin.

What I want is to make some modifications in the plugin code and re-build it using eclipse to generate a new jar file.

please advice.

Mahmoud Farahat

ok i found a way to overcome this issue , It's mainly caused by my lack understanding to how cordova plugins works , so i decided to write steps , it may help someone who has few knowledge about java and cordova plugins.

to edit a downloaded (with source-code) plugin from github

  • you don't need to install eclipse at all.
  • you need to have some knowledge in java and android API
  • in visual studio navigate to your plugin source code under plugins folder , in this case it's \plugins\com.phonegap.plugins.PushPlugin\src\android\com\plugin\gcm
  • find the plugin starting class which will be a class extends CordovaPlugin
  • edit what you want in java code
  • now in order to re-build java code , you MUST Clean cordova project before making a new deploy.

That's all.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create a Cordova plugin for Android with obfuscated code?

From Dev

How to create a Cordova plugin for Android with obfuscated code?

From Dev

Cordova Android Build Exit Code 8

From Dev

Cordova Android Build Exit Code 8

From Dev

unable to make cordova android build with phonegap-plugin-push, cordova-plugin-crosswalk-webview, and cordova-plugin-health

From Dev

Unable to find source java class while developing plugin for cordova (Android)

From Dev

Build error after adding Crosswalk plugin to a Cordova Android project

From Dev

Android App build with Monaca IDE and cordova phonegap-facebook-plugin

From Dev

Cordova plugin error on build, diamond operator isnot suported in source 1.6 use source 7

From Dev

Cordova Prepare/Build Unbinds WWW folder from Source Control (SVN)

From Dev

'Decimal' source code from Microsoft - will it build?

From Dev

Can't build Cassandra from source code

From Dev

Error code 1 cordova plugin file transfer android

From Dev

Cordova plugin - Javascript receive message from native code

From Dev

Android cordova plugin : NoClassDefFoundError

From Dev

Cordova android plugin debugging

From Dev

Build bundled Android Google Apps from source

From Dev

Build Talk [libjingle] from WebRTC source for Android

From Dev

How to get Cordova 3.4.0 to set Android version name/code on build?

From Dev

Cordova geolocation plugin not getting location from GPS for Android

From Dev

How to pass data from cordova plugin to index.html in Android

From Dev

Cordova camera plugin, obtain full image path from gallery [ANDROID]

From Dev

How get data from cordova-plugin-nativestorage in android java

From Dev

How get data from cordova-plugin-nativestorage in android java

From Dev

Not getting callbacks from my custom Cordova plugin (Android)

From Dev

Cordova Build Error for Android

From Dev

Cordova Build Android Errors

From Dev

Cordova Build Error for Android

From Dev

Import native android source code to android studio and build

Related Related

  1. 1

    How to create a Cordova plugin for Android with obfuscated code?

  2. 2

    How to create a Cordova plugin for Android with obfuscated code?

  3. 3

    Cordova Android Build Exit Code 8

  4. 4

    Cordova Android Build Exit Code 8

  5. 5

    unable to make cordova android build with phonegap-plugin-push, cordova-plugin-crosswalk-webview, and cordova-plugin-health

  6. 6

    Unable to find source java class while developing plugin for cordova (Android)

  7. 7

    Build error after adding Crosswalk plugin to a Cordova Android project

  8. 8

    Android App build with Monaca IDE and cordova phonegap-facebook-plugin

  9. 9

    Cordova plugin error on build, diamond operator isnot suported in source 1.6 use source 7

  10. 10

    Cordova Prepare/Build Unbinds WWW folder from Source Control (SVN)

  11. 11

    'Decimal' source code from Microsoft - will it build?

  12. 12

    Can't build Cassandra from source code

  13. 13

    Error code 1 cordova plugin file transfer android

  14. 14

    Cordova plugin - Javascript receive message from native code

  15. 15

    Android cordova plugin : NoClassDefFoundError

  16. 16

    Cordova android plugin debugging

  17. 17

    Build bundled Android Google Apps from source

  18. 18

    Build Talk [libjingle] from WebRTC source for Android

  19. 19

    How to get Cordova 3.4.0 to set Android version name/code on build?

  20. 20

    Cordova geolocation plugin not getting location from GPS for Android

  21. 21

    How to pass data from cordova plugin to index.html in Android

  22. 22

    Cordova camera plugin, obtain full image path from gallery [ANDROID]

  23. 23

    How get data from cordova-plugin-nativestorage in android java

  24. 24

    How get data from cordova-plugin-nativestorage in android java

  25. 25

    Not getting callbacks from my custom Cordova plugin (Android)

  26. 26

    Cordova Build Error for Android

  27. 27

    Cordova Build Android Errors

  28. 28

    Cordova Build Error for Android

  29. 29

    Import native android source code to android studio and build

HotTag

Archive