Basic Vaandroid Tutorial

We will now create a Vaandroid application. Our application will run as a web site instead of an Android file that must be installed on a device.

Add Files To Project

Add vaandroid.xml and pom.xml to the root of your project module (HelloWorld/app).

vaandroid.xml
Sets the location of manifest and resource files. Configures permissions of plugins and activities.
pom.xml
Similar to Gradle, the POM manages dependencies and build configurations.

Add PluginImpl.java and ResourceImpl.java to src/vaandroid/java/\<path-to-your-package>. You will have to change the package declarations to match your package.

PluginImpl.java
Registers your plugin in the OSGi runtime.
ResourceImpl.java
Bridges your resources to the system.

Install Maven

You can simply download Maven, unpack it, and run the command from the bin directory. Download Maven here.

Package Your Plugin

Go to the directory of your pom.xml file and run the Maven package command.

> ~/Downloads/apache-maven-3.3.9/bin/mvn package -Dmaven.test.skip=true

or

> mvn package -Dmaven.test.skip=true

Your plugin will be available as /target/tv.twelvetone.vaandroid.plugin.helloworld-1.0-SNAPSHOT.jar

Install Your Plugin Into the Vaandroid Cloud Server

There are 2 ways to install a plugin into the Vaandroid Cloud Server

  • Drop the file into the karaf/deploy directory
  • Install the file from the Karaf console
    • The source can be from a Maven repository or a local file.
    • You can configure Karaf to watch for changes in the local repository and update the plugin every time it changes.

Once installed, your plugin should just appear on the home screen.