---
title: 'Creating A Vaandroid Application From Scratch'
url: 'https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/creating-a-vaandroid-application-from-scratch'
markdown: 'https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/creating-a-vaandroid-application-from-scratch.md'
date: '2026-09-25'
description: 'This tutorial creates a basic Vaandroid application. Overvi'
taxonomy:
  category:
    - docs
---

[](#)  [ Home ](https://www.twelvetone.tv/docs/)     [ Operating Systems ](https://www.twelvetone.tv/docs/operating-systems)     [ Vaandroid ](https://www.twelvetone.tv/docs/operating-systems/vaandroid)     [ Vaandroid Developer Guide ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide)     [ Tutorials ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials)      Creating A Vaandroid Application From Scratch    

# Creating A Vaandroid Application From Scratch

This tutorial creates a basic Vaandroid application.

# Overview

This tutorial creates a Vaandroid application that contains a text input field, and button. When the button is pressed, an alert message is displayed.

We will use the Vaandroid Gradle Plugin to make the process super easy.

# Create The Gradle Project

Create an empty folder containing 2 files: settings.gradle and build.gradle. This is a basic Gradle project setup with 1 plugin, the Vaandroid Gradle plugin, applied.

settings.gradle

```groovy
pluginManagement {
    repositories {
        maven { url 'https://repo.twelvetone.tv' }
        gradlePluginPortal()
    }
}
```

build.gradle

```groovy
plugins {
    id 'vaandroid.plugin' version '1.0'
}

repositories {
    mavenLocal()
    mavenCentral()
}

vaandroid {
    // Not required if you use Gradle project group and name as your package name
    pkg = 'com.test.mypackage'
}
```

# Create The Application

Run the create\_vaandroid\_application task. It will create the following files:

- AndroidManifest.xml
- A res directory with various Android resources
- MySampleActivity.java
- R.java (withing the generated directory)

In addition, there are 2 Vaandroid specific files

- vaandroid.xml
- PluginImpl.java

If all goes well, you should have an application in the /build/libs directory.

### Launch The Server

Run the launch\_cloud\_server task. A server will be built and launched in a terminal window.

Open a web brower to <https://localhost:8443> to view the server. Click the ''Login Button'' to navigate to the home screen.

Run deploy\_to\_cloud\_server to install your new app. This task simply copies your jar file into the build/karaf/deploy directory. You should see your application appear on the home screen.

### Update The Application Layout

Replace the contents of /res/layout/activity\_template.xml with the following standard Android layout code. Then run deploy\_to\_cloud\_server.

```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:padding="16dp">

    <EditText
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textMultiLine"
        android:lines="3"
        />

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Submit"/>

</LinearLayout>
```

### Update The Application Logic

Replace MySampleActivity with this code, and then run deploy\_to\_cloud\_server.

```
package tv.twelvetone.vaandroid.test.my_sample_application

import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import android.widget.Toast
import tv.twelvetone.vaandroid.api.android.VaandroidActivity

class MySampleActivity extends VaandroidActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState)
        setContentView R.layout.activity_template

        TextView textView = findViewById(R.id.text)
        Button button = findViewById(R.id.button)

        button.setOnClickListener({
            Toast.makeText(this, textView.getText(), Toast.LENGTH_SHORT).show()
        })
    }
}
```

 [ ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/adding-an-activity) [](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/creating-a-vaandroid-plugin)

---

## Navigation

- Parent: [Tutorials](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials.md)
- Previous: [Adding An Activity](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/adding-an-activity.md)
- Next: [Creating A Vaandroid Plugin](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/creating-a-vaandroid-plugin.md)
