android-mesosfer-integration

How to Build Login and Session Android Mobile Apps in Mesosfer Backend as a Service

How to Build Login and Session Android Mobile Apps in Mesosfer Backend as a Service

Introduction

This tutorial is the third session of tutorial series. You can read the previous session here. In the implementation of this session, you will need more source code dependency you built in the previous session. I suggest you follow the previous session first, then go to this section. In this session, we will build login module in Android apps.

Prerequisites

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

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

Getting Started

Now, you have an account that proceed form previous session.

how-to-build-android-mobile-application-signup-in-mesosfer-cloud-platform-result-user

You can try to login using that account in this session. The first step to do is add LoginActivity.

how-to-build-login-and-session-android-mobile-apps-in-mesosfer-backend-as-a-service-login-activity

Then go to layout folder, add script login form in app->scr->main->res->layout->activity_login.xml:

Then insert logic into LoginActivity to handle login process. For this step, first thing you need to do is initialize textInput in method onCreate.

After that, create method HandleLogin to run authentication process to Mesosfer Backend.

We need to create MainActivity for handling navigation when login success.

how-to-build-login-and-session-android-mobile-apps-in-mesosfer-backend-as-a-service-main-activity

Change layout on app->scr->main->res->layout->activity_main.xml

You have to add script in MainActivity Class for handling navigation logout process.

In the login layout, you need to put button that will navigate to register page. To handle that, you should put method in LoginActivity Class.

If you run the application and login registered user, it will show result as in picture below:

how-to-build-login-and-session-android-mobile-apps-in-mesosfer-backend-as-a-service-login-process

Everything is done! Download full version code here.

Conclusion

We created login module in Android mobile apps. You can build authentication, with only using two functions/methods. functions/method. It’s an easy way for developers. You don’t need to build database structure by using sqlLite or middleware , etc. You only need Mesosfer Backend as a Service and use Mesosfer SDK.

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.

Lead Mobile Software Engineer. Having more than 8 years in IT Consultant. Love working with new mobile platform technology. Expert in Android and iOS Mobile Development.