Creating DroidScript Plugins on Mobile with AIDE - 2 (DS SDK)
In this post I'll show you a builtin variant in DroidScript to create plugin templates for DroidScript.
To access it you need to have a file called '_sdk_' in your DroidScript project folder. you can create it programmatically by executing 'app.WriteFile("/sdcard/DroidScript/_sdk_","");'
If you're premium it is enabled by default.
Type the name you wish for your plugin and press 'Create'
You can choose wether to create a basic plugin or a controls plugin which has an impact on the plugin template code.
This will generate a folder in /sdcard/AppProjects/MyPlugin and open AIDE automatically
either Install and execute the plugin apk
or just copy the MyPlugin.apk file from /sdcard/Android/data/com.aide.ui/cache/apk/ to /sdcard/DroidScript/Plugins
At last (Re)start DroidScript to install the plugin.
You should see your plugin listed there.
Open it and you'll see the documentation page of your plugin
Try to run any of the examples at the bottom - if they work you're done :)
You can finally begin building your Java plugin for your DroidScript application!
If you have questions about the JavaScript part (DroidScript) feel free to ask in the official DroidScript Forum.
Happy coding!
To access it you need to have a file called '_sdk_' in your DroidScript project folder. you can create it programmatically by executing 'app.WriteFile("/sdcard/DroidScript/_sdk_","");'
If you're premium it is enabled by default.
Install AIDE on your Smartphone
You can directly download it from Google Playstore. You should run it at least one time before continuing!Create the Plugin Template
To create a basic template you have to open DroidScript and select 'SDK' in the menuType the name you wish for your plugin and press 'Create'
You can choose wether to create a basic plugin or a controls plugin which has an impact on the plugin template code.
This will generate a folder in /sdcard/AppProjects/MyPlugin and open AIDE automatically
Building the Plugin
Press the 'run' button to compile the java codeInstall the Plugin in DroidScript
There are two possibilities to install the plugin now:either Install and execute the plugin apk
or just copy the MyPlugin.apk file from /sdcard/Android/data/com.aide.ui/cache/apk/ to /sdcard/DroidScript/Plugins
At last (Re)start DroidScript to install the plugin.
Test it out!
You can try whether everything worked well by going into the Plugins section in the DroidScript Docs.You should see your plugin listed there.
Open it and you'll see the documentation page of your plugin
Try to run any of the examples at the bottom - if they work you're done :)
Additional Informations
If you have questions about Android Java you should have a look at https://developer.android.com - there you'll find a complete reference for EVERYTHING which is available for android, as well as examples and much more. Check it out!If you have questions about the JavaScript part (DroidScript) feel free to ask in the official DroidScript Forum.
Happy coding!
Alex,
ReplyDeleteAs far as I know non-premium users don't get automatic access to the SDK menu option though it is easy enough to enable.
It says in the 1.34 release notes,
"I've hidden the SDK menu for non-premium users because I don't want to confuse newbie coders, but 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."
Thanks Steve - I've added it :)
Delete