Creating A Vaandroid Plugin

This page consists of a list of the things necessary to create a plugin with links to how to do so

Vaandroid.xml

  • Place file in root directory

https://developer.android.com/guide/topics/manifest/manifest-intro.html|AndroidManifest.xml

  • Follow the format of on Androids website
  • Place file in root directory

pom.xml

res directory - link to android website

src directory

  • Include the following the activities folder. These are the files necessary to register your plugin

Register the plugin

DS - [https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.core.doc/ae/twlp_declare_services_ds.html|Declarative Services]

Res helper files

  • In the res dir, files such as the following (strings.xml could be helpful)
strings.xml
<resources>
    <string name="app_name">Your app name</string>
</resources>

Launcher activities

Start a new Maven project

*Give the project a groupId

  • tv.twelvetone.vaandroid.plugin
    • Give the project an artifactId. This tutorial uses the name 'tutorial_1'
  • tv.twelvetone.vaandroid.plugin.tutorial_1
    • Name the project the same thing as above

Creating new directories and adding files

  • Create a new directory inside src/main/java *Name it the same as your artifactId from above
  • Create 3 classes inside this directory
    • Name the classes MainActivity, and PluginImpl
  • Create a directory named 'activities' on this level
  • Move MainActivity into this class

Edit the 2 files

Edit the pom file

  • Here's an example pom.xml

Add a file called Vaandroid.xml

  • Link to the manifest, resources directory, and others as fit
  • Define permissions

Go to modules in the project structure, add an android module

  • Select the top element, and change the sdk to the android sdk
  • Attention IntelliJ Users: make sure you deselect 'Generated Sources' from the Generated Sources Tab, as it is not necessary

Add a directory named res

  • Add the following subdirectories
    • drawable, layout, menu, and value
  • In layout, add the following file
    • activity_template.xml
  • In value, add the following files
    • strings.xml
    • Replace the text 'Your app name' with your application name
    • dimens.xml, styles.xml

Add the https://developer.android.com/guide/topics/manifest/manifest-intro.html|AndroidManifest.xml file

  • Make sure the package name has your project name in it
  • Make sure the activity name is correct