0% found this document useful (0 votes)
12 views36 pages

Mad Finalreport

Uploaded by

lakshmi shree
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views36 pages

Mad Finalreport

Uploaded by

lakshmi shree
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

EXPENSE TRACKER APP

MOBILE APPLICATION DEVELOPMENT -INT18R304

X-COMPONENT ACTIVITY- PROJECT REPORT

Submitted by
PRIYADHARSHINI J(9919008035)
PRASANNA DEVI(9521008401)
LAKSHMI SHREE M(9919008021)
K SRAVANI(9920008057)

In partial fulfilment for the award of the degree of

BACHELOR OF TECHNOLOGY
IN
INFORMATION TECHNOLOGY

DEPARTMENT OF INFORMATION TECHNOLOGY


SCHOOL OF COMPUTING
KALASALINGAM ACADEMY OF RESEARCH AND EDUCATION
KRISHNANKOIL 626 126
JUNE 2022 – DECEMBER 2022
BONAFIDE CERTIFICATE

Certified that this project report “EXPENSE TRACKER APP” is the bonafidework
of “J.Priyadharshini (9919008035), Lakshmi Shree M (9919008021), Prasanna
Devi (9521008401), K Sravani (9920008057)” who carried out the project work
undermy supervision.

SUPERVISOR` HEAD OF THE DEPARTMENT

MR.S.KAILASAM Dr. S.DHANASEKARAN

ASSOSCIATE PROFESSOR ASSOSCIATE PROFESSOR


DEPARTMENT OF IT DEPARTMENT OF IT
KALASALINGAM ACADEMY OF KALASALINGAM ACADEMY OF
RESEARCH AND EDUCATION RESEARCH AND EDUCATION

Submitted for the Project Viva-voce examination held on................….

Internal Examiner External Examiner


DECLARATION BY THE STUDENT

I hereby certify that the work which is being presented in the B.Tech.
Community Service Project Report entitled “EXPENSE TRACKER
APP”, in partial fulfilment of the requirements for the awardof the Bachelor of
Technology in Information Technology and submitted to the Department of
Information Technology of Kalasalingam Academy of Researchand Education
(Deemed to be University) – Tamil Nadu., is an authentic recordof my own work
carried out during a period from June to December 2022 underthe supervision of
Mr.S.Kailasam .

SIGNATURE SIGNATURE SIGNATURE SIGNATURE

J.Priyadharshini Lakshmi Shree M K.Sravani Prasanna Devi


9919008035 9919008021 9920008057 9521008401

This is to certify that the above statement made by the candidate is correct to the
best of my knowledge.
ACKNOWLEDGEMENT

First, we would like to thank the supreme power the Almighty God who is
obviously the one has always guided us to work on the right path of life.

We would like to express our humble thanks to our chancellor “Illaya vallal” Dr.
K. Sridharan B.Com., M.B.A., M.Phil., Ph.D., for giving such a great
opportunity to do our project successfully.

We express our sincere thanks to our Vice President Dr.S.Shasi Anand Ph.D.,
and Vice President Mr.S.Arjun Kalasalingam M.S., for granting permission to
carry out this project work at KARE , Anand Nagar, Krishnankoil.

We take this opportunity to thank our honourable Registrar Dr.V.Vasu Devan


for his kind permission to do the project.

Also, I express my sincere thanks to Dr. P. Deepalakshmi, School of


computing Dean of the Information Technology for her ardent guidance.

It is a genuine pleasure to express our deep sense of thanks and gratitude to our
Head of the Department Dr.S.Dhanasekaran, M.Tech.Ph.D., Associate
Professor and Head of the Department, Department of Information Technology,
KARE, Krishnankoil who provide an opportunity and support do the project
work.

Also, we thank our Guide Mr.S.Kailasam for his constant support and
encouragement; we also thank him for his valuable, care, motivationand patience.
We are happy to him as a guide and well-wisher.
TABLE OF CONTENT

CHAPTER NO TITLE PAGE NO

1 ABSTRACT 1
2 INTRODUCTION 2
3 OVERVIEW OF THE PROJECT 3

4 CONCLUSION 44
5 REFERENCE 45
ABSTRACT

Expense Tracker is an android mobile application which is used to track the expenses of the
users. This application is very easy to use and shows the expenses made by the user. The user
can update the salary and then they can enter their expenses details. Then it calculates the total
expenses and compare it with the salary. So the user can view their expenses and can track
their activity. So they can control the expenses in the future. This app contains registeration
module and login module. The user can register with the application and can login the app.
Then they can update their salary and can enter their expenses. This app gives the total expenses
made and the user can view their expenses.

[6]
INTRODUCTION

There are many applications for Android mobile platform. Since Billions of devices runs in
android. Almost all the types of application is available in the market. So we develop an
expense tracker application which helps the user in monitoring the expenses and compare it
with the salary. So the user can know about the expenses made by them and they can calculate
how much of expenses are they doing. This application helps the users to monitor their own
expenses and they can plan in future about their expenses to be done.
The application is user friendly and any one having android mobile can use this application. A
registration is necessary and then the user can login and can update their daily expenses. Then
the application compares the total expenses made with the salary given and show the result.

[7]
PROBLEM STATEMENT

Register
The new user can register with the application in this module. The user name, city, mobile,
email and password is entered and stored.
Login
The user can login the app by the user id (email id) and the password. Then the user is allowed
to enter the application.
Update Salary
The user can update their salary in this module. Then it is stored in the database.
Update Expenses
In this module the user can update their expenses. The expense name and the amount is entered
and it is stored and the total is calculated. The expense total is compared with the salary and
the report is shown to the user.

[8]
OVERVIEW OF THE PROJECT:
In this project we are guiding the user step by step manner. The following
are the pages that we have added in the app,

They are :

1. HOME SCREEN

2. REGISTRATION

3. LOGIN

4. EXPENSES

5. UPDATED

6. VIEW EXPENSES

[9]
HOME SCREEN :

Source Code:
package com.example.expensetracker;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {

TextView v1;
private EditText t1,t2;
private Button b1;
SharedPreferences sn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
t1 = (EditText) findViewById(R.id.editText1);
t2 = (EditText) findViewById(R.id.editText2);

[10]
v1 = (TextView) findViewById(R.id.textView4);
b1 = (Button) findViewById(R.id.button1);
sn = getSharedPreferences("user", Context.MODE_PRIVATE);
v1.setOnClickListener(this);
b1.setOnClickListener(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
//getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public void onClick(View v) {
switch(v.getId()) {
case R.id.textView4:
startActivity(new Intent(this, Regn.class));
break;
case R.id.button1:
if(check()) {
checkLogin();
}
break;
}
}

[11]
private boolean check() {

if(t1.getText().toString().trim().equals("")||t2.getText().toString().trim().equals(""
)) {
Toast.makeText(this, "Enter Userid/Password",
Toast.LENGTH_LONG).show();
return false;
} else
return true;
}

public void checkLogin() {


DBTask db = new DBTask(this);
db.open();
String uname = db.loginValidate(t1.getText().toString().trim(),
t2.getText().toString().trim());
if(uname!=null) {
sn = getSharedPreferences("user", Context.MODE_PRIVATE);
sn.edit().putString("userid", t1.getText().toString().trim()).commit();
sn.edit().putString("uname", uname).commit();
startActivity(new Intent(this, UserHome.class));
cls();
} else {
Toast.makeText(this, "Invalid Userid/Password...!",
Toast.LENGTH_SHORT).show();
}
db.close();
}

[12]
private void cls() {
t1.setText(""); t2.setText("");
}

Screenshot:

[13]
REGISTRATION PAGE:
If the user is new to the application they should register first.
In registration page the user will be asked to fill some basic details like username,
Password .
Source code:
package com.example.expensetracker;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;

[14]
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class Regn extends Activity implements OnClickListener {

private EditText t1,t3,t4,t5,t6;


Button b1;
private SharedPreferences sp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.regn);
t1 = (EditText) findViewById(R.id.editText1);
t3 = (EditText) findViewById(R.id.editText3);
t4 = (EditText) findViewById(R.id.editText4);
t5 = (EditText) findViewById(R.id.editText5);
t6 = (EditText) findViewById(R.id.editText6);
b1 = (Button) findViewById(R.id.button1);
b1.setOnClickListener(this);
}

@Override
public void onClick(View v) {
if(check()) {
DBTask db = new DBTask(this);
db.open();

[15]
long l = db.regn(t1.getText().toString().trim(),
t3.getText().toString().trim(), t4.getText().toString().trim(), t5.getText().toString().trim(),
t6.getText().toString().trim());
if(l>0) {
showMsg();
} else {
Toast.makeText(this, "UserId Exists...!",
Toast.LENGTH_SHORT).show();
}
db.close();
}
}

public void showMsg() {


Toast.makeText(this, "Registered Successfully...!",
Toast.LENGTH_SHORT).show();
cls();
finish();
}

private boolean check() {


if(t1.getText().toString().trim().equals("")) {
Toast.makeText(this, "Enter Name", Toast.LENGTH_SHORT).show();
return false;
}
if(t3.getText().toString().trim().equals("")) {
Toast.makeText(this, "Enter City", Toast.LENGTH_SHORT).show();
return false;
}

[16]
if(!t4.getText().toString().trim().matches("[9876]\\d{9}")) {
Toast.makeText(this, "Invalid Mobile", Toast.LENGTH_SHORT).show();
return false;
}
if(!t5.getText().toString().trim().matches("[a-z\\.]+[0-9]{0,}[a-z]{0,}\\@[a-
z]+\\.([a-z]{3}|[a-z]{2}\\.[a-z]{2}){1}")) {
Toast.makeText(this, "Invalid Email", Toast.LENGTH_SHORT).show();
return false;
}
if(t6.getText().toString().trim().equals("")) {
Toast.makeText(this, "Enter Password",
Toast.LENGTH_SHORT).show();
return false;
}
return true;
}

private void cls() {


t1.setText(""); t3.setText(""); t4.setText(""); t5.setText("");
t6.setText("");
}
}

class RegnTask extends AsyncTask<String, Void, String> {

private Regn activity;


ProgressDialog pdialog;
HttpEntity entity=null;

[17]
public RegnTask(Regn activity) {
this.activity = activity;
}

@Override
protected void onPreExecute() {
super.onPreExecute();
pdialog = ProgressDialog.show(activity,"Please Wait","Uploading is in
Process...!",false,false);
}

@Override
protected String doInBackground(String... p) {
String s="";
try {
List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("uname", p[1]));
nameValuePairs.add(new BasicNameValuePair("city", p[3]));
nameValuePairs.add(new BasicNameValuePair("mobile", p[4]));
nameValuePairs.add(new BasicNameValuePair("userid", p[5]));
nameValuePairs.add(new BasicNameValuePair("pwd", p[6]));

try {
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(p[0]);
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

HttpResponse response = httpClient.execute(httpPost);

[18]
entity = response.getEntity();

s = EntityUtils.toString(entity,"UTF-8");
} catch (ClientProtocolException e) {
Log.e("ClientProtocol","Log_tag");
e.printStackTrace();
} catch (IOException e1) {
Log.e("Log_tag", "IOException");
e1.printStackTrace();
}

} catch (Exception e) {
Log.e("RegnTask", e.getLocalizedMessage());
} finally {
try {
} catch (Exception e) {
}
}
return s.trim();
}

@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
pdialog.dismiss();
}
}

[19]
Screenshot:

[20]
LOGIN:
Source Code:
package com.example.expensetracker;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class UserHome extends Activity implements OnClickListener {

TextView v1;
SharedPreferences sn;
Button b1,b2;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.userhome);
b1 = (Button) findViewById(R.id.button1);
b2 = (Button) findViewById(R.id.button2);
v1 = (TextView) findViewById(R.id.textView1);
sn = getSharedPreferences("user", Context.MODE_PRIVATE);
v1.setText("Welcome, "+sn.getString("uname", ""));
b1.setOnClickListener(this);
[21]
b2.setOnClickListener(this);
}

@Override
protected void onDestroy() {
super.onDestroy();
sn.edit().remove("userid").commit();
sn.edit().remove("uname").commit();
}

@Override
public void onClick(View v) {
switch(v.getId()) {
case R.id.button1:
startActivity(new Intent(this, UpdateSalary.class));
break;
case R.id.button2:
startActivity(new Intent(this, UpdateExpenses.class));
break;
}}}

[22]
Screenshot:

[23]
UPDATED SALARY:
Source Code :
package com.example.expensetracker;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class UpdateSalary extends Activity implements OnClickListener {

TextView v1;
SharedPreferences sn;
Button b1;
EditText t1;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.updatesal);
t1 = (EditText) findViewById(R.id.editText1);
b1 = (Button) findViewById(R.id.button1);
sn = getSharedPreferences("user", Context.MODE_PRIVATE);
[24]
b1.setOnClickListener(this);
}

@Override
public void onClick(View v) {
if(!t1.getText().toString().trim().equals("")) {
DBTask db = new DBTask(this);
db.open();
int x = db.updateSal(sn.getString("userid", ""),
t1.getText().toString().trim());
if(x>0) {
Toast.makeText(this, "Salary Updated...!",
Toast.LENGTH_LONG).show();
}
db.close();
}
}
}

[25]
Screenshot:

[26]
EXPENSES:
Source Code:
package com.example.expensetracker;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class UpdateExpenses extends Activity implements OnClickListener {

TextView v1;
SharedPreferences sn;
Button b1;
EditText t1,t2;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.updateexp);
t1 = (EditText) findViewById(R.id.editText1);
t2 = (EditText) findViewById(R.id.editText2);
b1 = (Button) findViewById(R.id.button1);
[27]
v1 = (TextView) findViewById(R.id.textView2);
sn = getSharedPreferences("user", Context.MODE_PRIVATE);
show();
b1.setOnClickListener(this);
}

@Override
public void onClick(View v) {
if(!t1.getText().toString().trim().equals("") &&
!t2.getText().toString().trim().equals("")) {
DBTask db = new DBTask(this);
db.open();
long x = db.updateExp(sn.getString("userid", ""),
t1.getText().toString().trim(), t2.getText().toString().trim());
if(x>0) {
Toast.makeText(this, "Expenses Updated...!",
Toast.LENGTH_LONG).show();
cls();
}
db.close();
show();
}
}

public void show() {


DBTask db = new DBTask(this);
db.open();
int sal = db.getSalary(sn.getString("userid", ""));
String s = db.getAllExpenses(sn.getString("userid", ""));

[28]
int tot = Integer.parseInt(s.substring(s.lastIndexOf(":")+1).trim());
if(tot>sal) {
s+="\nYour Salary : Rs."+sal+"\n(Expenses Exceeded...!)";
}
v1.setText(s);
db.close();
}

private void cls() {


t1.setText(""); t2.setText("");
}
}

[29]
Screenshot:

[30]
UPDATES AND VIEW EXPENSE:
Source Code:
package com.example.expensetracker;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

public class ViewExp extends Activity implements OnClickListener {

TextView v1;
SharedPreferences sn;
Button b1;
Spinner sp1;
String mth[] =
{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
ArrayAdapter<String> adapter1=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
[31]
setContentView(R.layout.viewexp);
b1 = (Button) findViewById(R.id.button1);
v1 = (TextView) findViewById(R.id.textView2);
sp1 = (Spinner) findViewById(R.id.spinner1);
adapter1 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, mth);

adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_ite
m);
sp1.setAdapter(adapter1);
sn = getSharedPreferences("user", Context.MODE_PRIVATE);
//show();
b1.setOnClickListener(this);
}

@Override
public void onClick(View v) {
show();
}

public void show() {


DBTask db = new DBTask(this);
db.open();
int sal = db.getSalary(sn.getString("userid", ""));
String s = db.getAllExpenses(sn.getString("userid", ""),
sp1.getSelectedItem().toString().trim());
int tot = Integer.parseInt(s.substring(s.lastIndexOf(":")+1).trim());
if(tot>sal) {
s+="\nYour Salary : Rs."+sal+"\n(Expenses Exceeded...!)";

[32]
}
v1.setText(s);
db.close();
}
}

Screenshot:

[33]
CONCLUSION :
Thus the app is developed with the features as mentioned above This app is
useful for users who want to track their expenses. It gives a clear knowledge
of the expense done. Expense tracker app is user friendly and cost effective
system. It will be very useful in day today life.

[34]
REFERENCE:

Google for Problem Solving

For Android:https://developer;.android.com/training/basics/firstapp

For Java tutorial:https://www.javatpoint.com/android-tutorial

For Database: https://firebase.google.com/

NPTEL

[35]
[36]

You might also like