Software Archive
Read-only legacy content
17061 Discussions

How to add and use jar file in project.

puneet_d_
Beginner
314 Views

I have an payment sdk jar file which I am using in native android project how to add that jar in xdk project. There I am required to call a constructor of a class with some arguments. How to...

0 Kudos
3 Replies
Swati_S_Intel1
Employee
314 Views

You cannot include a jar file in the XDK project. The XDK project runs as an HTML5 project inside the webview of a device. To run native code you have to create a plugin and expose the functionality of your native code at javascript layer. You can find examples of the plugins under plugins management,  "Get Documentation" link on any of the plugins takes you to plugin's github repository where you can see how plugins are implemented or see this Cordova Plugins Development Guide.

0 Kudos
puneet_d_
Beginner
314 Views

Is it possible to create plugin of a jar file. I am trying with BillDesk payment gateway and I am just having its .jar.

0 Kudos
Swati_S_Intel1
Employee
314 Views

You cannot use .jar as is as a plugin. You might be able to use a java decompiler and reverse engineer the jar. Ultimately you have to put together a plugin with Java source code (for Android) and expose it at JavaScript layer.

 

0 Kudos
Reply