How to Add and Delete Data Android Mobile Apps in Mesosfer Backend as a Service

This tutorial is about How to Add and Delete Data Android Mobile Apps in Mesosfer Backend as a Service.


This Tutorial is the seventh session of Android Mobile Apps series. In this tutorial you will be required some dependency source code you created in the previous session. In this session, we’ll create module to add and delete data in a Mesosfer Bucket.


To follow this tutorial, you will need to prepare these items below :

  • Sign up for an account in Mesosfer Backend as a Service.
  • Have a Mesosfer Bucket.
  • Install latest android studio. In this tutorial, the author used android studio version 2.2.1
  • Download code from previous section.

Getting Started

In previous sessions, we have tried to make the bucket in Mesosfer Backend as a Service and display the data content in Android Apps. Then for the next we will create a function to add and delete data.

Firstly, you have to add a new activity (DataFormActivity) to display a new data input form.


Go to layout->activity_data_form.xml then add the script below:

Change DataFormActivity then add variable inisialisasai below, put on onCreate method.

Then initiate in method onCreate.

Go to layout and add button in activity_data.xml.

Then change DataActivity, and add method handleAddAnimal and set mode with value FORM_MODE_ADDD.

In mobile apps, it will show result as in picture below.


Then to handle the save button, then DataFormActivity added code below.

Add method to validate.

If the data is valid, execute method saveAnimal.

To ensure that the data you add is working, you need to check into the Mesosfer Backend as a Service.


To delete the data, you simply click on the data line and Add method below. Before define code onItemClick, you need to add menu above method onCreate.

After that put this code below.

confirmation will be shown.


Then add method delete Animal, this method will be confirmation when the dialogue is processed.

To ensure that the data you add is working, you need to check into Mesosfer Backend as a Service.


Everything is done! Download full version code here.


We have created module to add and delete data on Mesosfer Bucket. Very simple and quick, isn’t it? Mesosfer helps you connect your project to the cloud. Cut off the development process so you can straight into the delivery process instead stumble on the complicated infrastructure.


Having more than 5 years experience in IT Consultant with the last position as Backend as a Service Developer and has an experience in planning, implementing IT Information System.