How to include jar file and execute jar library

158 views
Skip to first unread message

John Kenedy

unread,
Feb 22, 2016, 10:20:34 PM2/22/16
to DroidScript
Hi i have a jar file written in Android studio, the input is a string and output is an array of string. I want to call it via DroidScript and let it execute and return string to Droidscript to display in the ui. Is that possible?

Steve Garman

unread,
Feb 23, 2016, 2:20:30 AM2/23/16
to DroidScript
Unless the jar has been written directly for DroidScript, using the plugin SDK (and is therefore already part of a plugin), you will almost certainly need to wrap it in a Java plugin to be able to access it.

John Kenedy

unread,
Feb 23, 2016, 9:45:08 AM2/23/16
to DroidScript
Hi Steve

May I know how to write my java library and wrap it in a java plugin for DroidScript?
I would like to port a my library to be able accessed by DroidScript


It accept script and some input parameters, the script will process the request and return output.

Basically I want :
DroidWrap a = new DroidWrap();
String ret = a.Execute("WC_MethodPage('http://www.innosia.com', 'GET', '', '')");

The Execute will execute syntax my language which basically does Web Automation, it is not as simple as above sample which shows only get a page and return HTML response, there are various methods that manipulate the output or send input to a website. Since re-writing it in Javascript takes lots of effort, I would like to make the already written java app to a jar and wrap it to be used by DroidScript.

Can show me some sample to make SDK plugin? Thanks

Dave Smart

unread,
Feb 24, 2016, 4:42:00 AM2/24/16
to DroidScript
Hi John,

You can get the plugin SDK here:- http://droidscript.org/plugin-sdk/

That is for Eclipse users, if you are an Ant command line user or an AIDE user then we can provide alternatives

John Kenedy

unread,
Feb 24, 2016, 5:28:40 AM2/24/16
to DroidScript
Hi Dave

I am Android Studio user, please provide me the plugin sdk

Thank you
Regards
John Kenedy

Chris Hopkin

unread,
Feb 24, 2016, 6:07:30 AM2/24/16
to DroidScript
Hi John

I'm afraid at the moment the DroidScript plugin generator only supports Eclipse, but Android Studio support is on the Todo list, I just haven't had the time yet.

It sounds like it might be a fairly simple plugin, so if you want, send me your jar file (privately) and I can take a look at wrapping it up in a plugin for you (when I get a spare few minutes).

Thanks

Chris
Reply all
Reply to author
Forward
0 new messages