Posts

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

Image
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. 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 menu 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 Building the Plugin Press the 'run' button to compile th

DroidScript Images

Image
In this post I will speak about images in DroidScript. They are the easiest way to display image files and also for drawing basic shapes like lines, rectangles, ellipses and even other images. The possibilities are endless - you can make image viewers, drawing apps, animations, visualizations, games and even your own controls. Content Load image files Basic Drawing Touch events Animating Image drawing and alias Load image files This is the most common usage of images - displaying. You can't just display png or jpg files - also gif's are possible! //Called when application is started. function OnStart() { //Create a layout with objects vertically centered. var lay = app.CreateLayout( "linear", "VCenter,FillXY" ); //Create png image and add it to layout png = app.CreateImage("/Sys/Img/Hello.png"); lay.AddChild(png); //Create gif image and add it to layout gif = app.CreateImage("/assets/edit

Creating DroidScript Plugins on Mobile with AIDE

Image
Install AIDE on your Smartphone You can directly download it from Google Playstore . You should run it at least one time before continuing! Install the AIDEPluginGen in DroidScript This is a free application written by Chris F. and Chris M. in DroidScript which allows you to simplify the install process of your plugin. It also includes a template for the Java and JavaScript code, a documentation template as well as a step by step guide (which is pretty help-full ) how to get started with it. You'll see many parallels to this post here - but it includes some additional informations which you should know. You can download it from the DroidScript Forum . The link will download an .spk file - you have to open it with DroidScript and it will automatically be added to your projects list. Create the Plugin Template To create a basic template you have to launch the AIDEPluginGen and press 'Create New DS Plugin' Type the name you wish for your plugin and press &#

Creating JavaScript Plugins for DroidScript

Image
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

Creating DroidScript Plugins on Desktop PC with Android Studio

Image
Install Android Studio 1. Download and select the AndroidStudio executable on https://developer.android.com/studio/index.html When having troubles or generally I suggest using the latest stable release package 'Windows IDE bundle with SDK' from https://developer.android.com/studio/archive.html 2. After installing Launch AndroidStudio Download and Build the UserPlugin Template 3. Download the UserPlugin template from https://github.com/DroidScript/Plugin-UserPlugin and extract it to your AndroidStudio project folder 4. Select 'Open an existing Android Studio project' and navigate to the extracted UserPlugins folder 5. AndroidStudio will now generate some gradle related stuff and later ask you to update the gradle version Keep an eye on the message log and install missing components, packages and dependencies 6. After everything is installed you can build the APK. After the apk was built gradle will try to copy it to your device usin

DroidScript Hello World Example

The 'Hello World' Project is the first app you will see in DroidScript. It creates an image and a button. And if you press the button, a "Hello World!" popup appears and the phone is vibrating. This is a very basic demonstration of how easy DroidScript can be used: - create the main app-layout. - add controls or more layouts to it - show the layout on screen This is the basic concept of how DroidScript works. Try it out yourself: Download DroidScript agate androidstudio arduino-light arta ascetic atelier-cave-dark atelier-cave-light atelier-dune-dark atelier-dune-light atelier-estuary-dark atelier-estuary-light atelier-forest-dark atelier-forest-light atelier-heath-dark atelier-heath-light atelier-lakeside-dark atelier-lakeside-light atelier-plateau-dark atelier-plateau-light atelier-savanna-dark atelier-savanna-light atelier-seaside-dark