Financial Management
Financial Management
Android is the Linux-based open-source operating system for mobile devices like smartphones
and tablets. However, nowadays, many other devices are incorporating android in them to turn
them into smart devices such as Smart TVs, Smart car interface for GPS, electrical appliances,
etc. This software was unveiled in 2007 and the first Android Device was launched in September
2008. Since then Google, the sponsor of Android has been releasing its software updates,
versions almost every year.
Android also offers several features:
1. NFC (Near Field Communications): NFC Allows electric devices to easily interact across
short distances.
2. Alternate keywords: It supports multiple keyboards & makes them easy to install.
3. Beautiful and Interactive UI
4. Storage: SQLite a lightweight relational DB is used for data storage.
5. Multi lang: Supports single direction & Bi-Directional.
1. Kotlin offers many pros like faster to write, unlike Java which is a type of heavy
language and therefore more code and increased chances for errors and bugs.
2. As Android is built on Java, there are plenty of Java Libraries. Kotlin uses these Java
Libraries and Java frameworks, thanks to Java Bytecode.
3. Java apps are lighter and compact resulting in a faster app experience.
There are many other pros and cons for both the languages. But if you are a beginner or new to
programming, learning and building Java is recommended. The choice you make entirely
depends on the need and requirements of your projects and also what interests you the most.
ASSIGNMENT
Let us look at an easy Android project Idea with source code to start with.
Use the example to create a login page for a KCA University login page
Login Page
Almost every Android application requires a user to make its signup page by providing its
credentials like name, email address, phone number, and then generating a user password to
login later. This is the most basic project to start with as whatever application you make a login
screen is a must whether the domain is health, food, pharmacy, shopping, social media, games
every app requires you to create an account so that the user can save its details and start from
their last session.
XML File:
The Login page XML file contains a user-friendly activity page that displays edit text fields for
the user to enter the required information. It also contains a button and two clickable text fields
to login, create accounts, and change passwords respectively. In the end it contains a clickable
text field for the new users to sign up.
Java File
The Login page Java file takes the inputs from the user and verifies and validates the data and
then stores the information into the local database.
Sample Code
XML File
package com.skarora.loginpage;
import android.content.Intent;
import android.database.Cursor;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
TextInputLayout username,password;
TextView create,change_pass;
Button login;
LoginData ld;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().hide();
username = findViewById(R.id.et_username);
password = findViewById(R.id.et_password);
login = findViewById(R.id.login_button);
create = findViewById(R.id.create);
change_pass = findViewById(R.id.change_password);
ld=new LoginData(this);
createUser();
loginUser();
changePassword();
}
public void loginUser(){
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String name = username.getEditText().getText().toString();
String pass = password.getEditText().getText().toString();
showMessage("Name",name);
showMessage("Pass", pass);
Cursor loginStatus= ld.validate(name,pass);
if(name.equals("") || pass.equals(""))
{
showMessage(" ERROR!! ", "EMPTY FIELDS");
}
else
if(loginStatus.getCount()==0)
{
Toast.makeText(getApplicationContext(),"hello",Toast.LENGTH_LONG).show();
// showMessage("Login Successful" , "You have successfully logged in :) ");
Intent in = new Intent(getApplicationContext(),Home.class);
startActivity(in);
}
else
{
Toast.makeText(getApplicationContext(),"hiii",Toast.LENGTH_LONG).show();
showMessage("ERRR...", "TRY AGAIN!!!!!");
}
}
});
}
public void createUser()
{
create.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getApplicationContext(),Create_Acc.class);
startActivity(i);
}
});
}
public void changePassword()
{
change_pass.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getApplicationContext(),ChangePass.class);
startActivity(i);
}
});
}
public void showMessage(String title, String message)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.show();
}
}