Android Login

An example of making a Login Activity

What tools do we need?

  • Android Studio (beta)
  • Volley (http://developer.android.com/training/volley/index.html)
  • IBM Bluemix (https://ace.ng.bluemix.net/)
    • NodeJS
    • ExpressJS
    • Cloudant DB

What do we need to do?

  • User enters loginName & password
  • Press a button to submit the login request
  • Use Volley to make a REST API call
  • ExpressJS listens for REST API request
    • Query Cloudant DB to validate loginName
  • If valid, navigate user to next activity
  • If not valid, inform user and stay on login Activity

Getting Started

Have Android Studio already installed and setup

Start a New Project

Add the Volley library to your project

 

Application Architecture

Device

IBM Bluemix

NodeJS

ExpressJS

Cloudant

Login

Login Name

********

[Android Studio]
Volley Library
Extend Application
Modify AndroidManifest.xml
Login Activity
Success Activity
[Sublime Text2]

[NodeJS]
Server App
[ExpressJS]
REST API methods
[Nano]
Connect to Cloudant
[Cloudant Dashboard]

Databases
Views

1

2

3

Android Studio

The native device code is written in Android Studio.

 

This is where the interactivity and displaying of data is performed with the user.

1

Sublime Text 2*

This is where we write the server-side JavaScript code that runs on top of NodeJS.

 

We use ExpressJS to expose REST API calls, within them we connect to Cloudant and retrieve the required data.

2

*Other editor tools are available

Cloudant

This is where we create the required Databases that contain the data we need to support the Android native application.

 

Cloudant is a Non-SQL database therefore the data is stored and returned in a JSON format, which makes using the Volley library extremely useful

3

Android Login

By Tony Pigram

Android Login

An example of making an Android Login mechanism using Volley, BlueMix, NodeJS, ExpressJS and Cloudant

  • 1,979