AIDE DroidScript Plugin Gen v1

540 views
Skip to first unread message

Chris

unread,
Nov 6, 2015, 6:30:04 PM11/6/15
to AndroidScript
If you are interested in creating java plugins for DroidScript using AIDE (Android Java IDE) app, this will not only help you, but make the process very simple.

There is a help option included, it will explain how to use this app, not AIDE, or how to program in java.

I used this in building my FtpClient, and use it now to start my plugins.

If you start with the full template it is easy to see how the plugin interacts with DS.

I hope this helps someone, it has made my process of creating plugins, rebuilding, etc very simple.

Happy Coding!
Chris

AIDEPluginGen.spk

Manuel Lopes

unread,
Nov 6, 2015, 7:16:32 PM11/6/15
to AndroidScript
Thanks chris

Netpower8

unread,
Nov 6, 2015, 8:34:46 PM11/6/15
to AndroidScript
thanks.

Elmer Martens

unread,
Nov 6, 2015, 9:11:24 PM11/6/15
to AndroidScript
Thanks, Chris :)

Mauritz Zondagh

unread,
Aug 10, 2016, 1:35:49 PM8/10/16
to DroidScript
Hi,
Thankyou for this spk template generator. Can see it simplifies Plugin generation.

After opening project in AIDE the java and inc files are empty. Is that correct? I know this is where I should put my code, can someone please help me with simple example for the 2 files doing anything. Just need it to get idea how it should look like e.g. parameters in and out of Droidscript

Thanks

Alex F

unread,
Aug 10, 2016, 1:40:25 PM8/10/16
to DroidScript
Thanks a lot :D

Alex F

unread,
Aug 10, 2016, 2:00:25 PM8/10/16
to DroidScript
I think now many of us will create and share plugins :D
this is the most useful app for ds development! Rate 🌟🌟🌟🌟🌟

Steve Garman

unread,
Aug 10, 2016, 2:13:07 PM8/10/16
to DroidScript
It is great and when Chris posted it, I used it a lot. Chris knows I am a great admirer. I learned more from him about plugins than I did from anyone.

However, the premium sdk is now built into DroidScript and I use it instead.

It produces very similar projects and the apks built by AIDE can be dropped into the Plugins folder in the same way as a zip.

The premium version of DroidScript comes with an sdk entry in the main menu to get started but if you do not have a Premium subscription, you can still access it.

You can get that menu as a non-premium user by creating a file called _sdk_ (with no extension) in your DroidScript folder on your phone or tablet.

Mauritz Zondagh

unread,
Aug 10, 2016, 3:01:56 PM8/10/16
to DroidScript
Ok, my mistake. I found the example code for the.java and .inc in Chris AIDE project files.
I initially moved files from Droidscript dir to AppProgram dir of AIDE with file explorer, causing the problem.(The help clearly states that you should have AIDE installed before running the script) :)
Reinstalled Chris SPK, and now the example code is populated.

So we continue!

Thanks

Alex F

unread,
Aug 10, 2016, 3:26:35 PM8/10/16
to DroidScript
Hm what I've to do to show an popup or a dialog. I only know how to do this in DS. So can I use DS code in plugins? And how

Mauritz Zondagh

unread,
Aug 10, 2016, 3:34:21 PM8/10/16
to DroidScript
Hi Alex,

of the File Explorer plugin is a javascript only plugin.Maybe it will help?

Alex F

unread,
Aug 10, 2016, 3:47:32 PM8/10/16
to DroidScript
Ur link doesn't work :/

Mauritz Zondagh

unread,
Aug 10, 2016, 3:52:41 PM8/10/16
to DroidScript
Search for "The plugin on the Javascript, please test" on the Droidscrip group. I searched for plugins and came across this quite down in the result.
Maybe the link does not work because i am signed into my google account?




Alex F

unread,
Aug 10, 2016, 5:12:46 PM8/10/16
to DroidScript
Is it normal that the class.dex file is left if I create a new plugin? I trued to create a plugin and add it to ds plugins but the class.dex file was left. What us this for a file?

Chris

unread,
Aug 10, 2016, 8:02:34 PM8/10/16
to DroidScript
If you are still using my gen - which by the way after looking at the DS main js - uses my code :-) it will use only what is needed for the plugin creation.

I still use my gen because I have a few different templates.

Glad you like it :-)

Alex F

unread,
Aug 11, 2016, 12:29:15 AM8/11/16
to DroidScript
Sure, but the classes.dex file (i wrote class.dex sorry ^^) is needed for the jar file what your app makes and it wasnt created by it. So how I get this file or make it myself? And what it is used for

Chris

unread,
Aug 11, 2016, 12:50:49 AM8/11/16
to DroidScript
Did you follow the instructions in the gen's help menu item?

Sounds like you are not compiling the plugin in AIDE. Try 'Project' - 'Rebuild' - it will compile the plugin.

Alex F

unread,
Aug 11, 2016, 1:12:17 AM8/11/16
to DroidScript
Thanks a lot :D
i added
this.Greet = function() {
app.ShowPopup( "Hello!" );
}
to the inc file and if i call plg.Greet() it works :D thank you very much.
Think I was too much exited so I hadnd seen it ^^

Alex F

unread,
Aug 11, 2016, 5:18:28 PM8/11/16
to DroidScript
If in DS an error happens Object has no method ... it shows a fusion of alert and app.Alert. (title, stop app but not closing it)
so how I can stop running the app with app.Alert

Steve Garman

unread,
Aug 12, 2016, 12:40:33 AM8/12/16
to DroidScript
Alex.
app.Alert() is asynchronous, it is not going to stop the app.

It looks like you want to display an error dialog from your .inc file, then exit.

To do this, you would need to create a custom dialog, then exit from the Ok button callback.

As a shortcut while developing, I use

var meth = "DoMagic";
throw "\n"+"Object has no method "+ meth;

Mauritz Zondagh

unread,
Aug 12, 2016, 4:22:42 AM8/12/16
to DroidScript
Hi Chris,

Would you be able to help me by creating a example of your Droidscript Plugin generator .java & .inc files (GetVersion example) to add extra commands which demonstrate the coding in the java & inc file to
1. Send parameters from Droidscipt to the java (multiple parameters, string, int, multidimensional array if possible)
2. Receive multiple parameters back from the Java to Droidscript (multiple parameters, string, int, multidimensional array if possible)

Your Getversion example returns a single string.

Returning a multidimensional array of string / int's would help lot. I am trying to write a read sms inbox plugin, but it would be better if i can rather write a Android content provider plugin. Therefore i need to return a database with columns and rows, and a multidimensional string array would do the trick.
To delete a entry in the database i need to send a int ID to the java from Droidscript, to specify which entry to delete. Therefore the request above.

I am new to Droidscript, also not a JAVA programmer, so the coding in/out of java including the inc file is something i do not understand yet.

Many thanks in advance.

Alex F

unread,
Aug 12, 2016, 4:56:51 AM8/12/16
to DroidScript
You can also return it in the inc file using DS code
this.GetArray= function() {return [[1,2],[3,4]]}

Alex F

unread,
Aug 12, 2016, 4:57:46 AM8/12/16
to DroidScript
I used it in my GraphView plugin. Look at the thread in the main group ;)

sankarshan dudhate

unread,
Aug 12, 2016, 11:23:39 PM8/12/16
to DroidScript
@Mauritz,

You can use parameters in plugin. If you don't check the "Minimalistic Template" check box, you can see how to use the params.

Just open .java & .inc files in AIDE ( or rather, any text editor or reader ). The params will be provided just as in js in the inc file. On the java side, you can see the functions being provide a "Bundle" parameter.

The bundle is then used to extract the parameters ( p1 - first, p2 - second ).

Regarding the arrays, you can convert the array to a string using "array.toString()" and return it, in Java. Then, convert it to an array again using arrayStringYouHave.split(",");

Роман Вешняков

unread,
Aug 13, 2016, 6:53:10 AM8/13/16
to DroidScript
Как установить?
How to install?

Dave Smart

unread,
Aug 13, 2016, 7:20:00 AM8/13/16
to DroidScript
See here for an explanation of how to get the official AIDE plugin generator working in DS



Alex F

unread,
Aug 13, 2016, 7:31:12 AM8/13/16
to DroidScript
If you use the 'AIDE Plugin Gen' try this:
after creating the plugin via 'AIDE' app, touch 'Build DS Plugin Zip' in the Plugin Gen and restart DroidScript. Then the Zip-File will be implemented automatically
Reply all
Reply to author
Forward
Message has been deleted
0 new messages