Creating JavaScript Plugins for DroidScript

I already spoke about JavaScript Plugins in DroidScript very shortly. Here I'll dive a bit into the details:

Do I need AndroidStudio?

No, you don't! Of course you can write your JavaScript code to the 'MyPlugin.inc' file - but you just don't need the other Java-related stuff around it!
The by far easiest way to create Plugins for DroidScript is DroidScript itself! But there are a few extra steps required to install it.
So in this post I will explain what you need to do to get your JavaScript plugin working in DroidScript:

Step 1 - Download the Plugin Generator

You can simply download a template from GitHub. It includes a plugin installer, de-installer and exporter. So you don't have to rename and zip your plugin yourself and you also don't need to restart DroidScript to install it.


Step 2 - Write your Plugin

The template already includes a GetVersion command. You can now extend the functionality just the same way as GetVersion to make your plugin to something special!

Step 3 - Documentation

I know you'll hate it - but it is necessary!
The Documentation.html template shows how your documentation should look like. Of course you can extend it in any way you want. But keep in mind that you should provide examples of important core functions and a complete list of all available functions including accepted arguments.

DroidScript uses JQuery-Mobile for its Docs - so you should read their documentation too to create an very well readable an understandable documentation.

Step 4 - Publishing

Just export the plugin zip and you can share your plugin with other users to make their life a bit easier. (The zip will normally be located in the template folder itself)

Feel free to share your plugin in the DroidScript forum. Don't forget to put a license on your plugin or at least a note how we should refer to you when using your plugin.

If you don't want to share your sources (i.e. because it is a huge thing where you spent your blood and sweat to it) you can contact Dave Smart.

You should also ask him if you want to let users charge for your plugin. (Premium users don't nevertheless)


Thats it!

When using the generator you're half done :)
It will speed up your development time a lot!

Hopefully we'll see many cool plugins in the future to help other app developers with the same problems like you to don't reinvent the wheel every times. And also for helping DroidScript to grow up.


Happy Coding!

Comments

Post a Comment

Popular posts from this blog

Creating DroidScript Plugins on Mobile with AIDE - 2 (DS SDK)

Creating DroidScript Plugins on Mobile with AIDE

Creating DroidScript Plugins on Desktop PC with Android Studio