Skip to content

dancannotcode/ExpenseTrackingAndroidApp

Repository files navigation

Expense Tracker

make it easier to track what you spend on

Table of Contents

Overview

The purpose of this project was to take in user data such as salary/expenses and with that information structure a budget for the user as well as hold the information as to what expenses the user made. The hope is so that users can visualize what they are spending their money on, as well better mange their money on items.

Demo

In progress still...

Screenshots

when the user first joins the app it prompts them for their salary, and then it calcuates a budget, and users can then start their tracking journey in which they fill out a form for the item.

landing page Screen picture input page for user data picture


This is the page a user goes to in order to chec the items they have purchased, and clicking on them provides more info. Sliding allows users to delete the item.
previous entries screen picture Screen shows how deletion of entry looks

Technologies Used

  • Java
  • Json
  • FireBase(yet to be implemented)

Setup Instructions

  1. Install Android Stuidos
  2. Run the application
  3. click on Clone Repository
  4. Paste Repository URL[https://github.com/dancannotcode/ExpenseTrackingAndroidApp.git]

How It Works

  1. User Set Up
    • The program retrives the users salary and saves it as SharedPreference
    • an Intent is called and sends to the home page activity
  2. Home Page UI
    • Retrive the data of User salary then calculate monthy budget for users
    • Button create will send user to the insert entry activity
    • Button log will send user to the logView activity
  3. Entry Insert
    • Load data of all expenses array so we can add the new expense for the user, from a SharedPreference
    • Creates an expense made by the user and tracks the expense as a SharedPreference
    • A category that is created is saved as a SharedPreference, and loaded again for user to select again once a new entry is created
    • Once user clicks save button, then it sends user back to the home page activity and saves the expense on expenseList as a Json object using SharedPreference
  4. Log View
    • First we load the expenses in our array through SharedPreference
    • Then eached expense is displayed as a recyclerView
    • An onSwipe function is used for users to delete an entry in our expoense array, and then our list is adjusted accordance to the deleted list
    • If an item is clicked on, an alertDialog is used for users to see info about the expense

Code Snippets

findViewById(R.id.save).setOnClickListener(v -> {
            //converts user Input into data of our expense
            expense.setDate(date.getText().toString());
            expense.setExpenseName(name.getText().toString());

            String stringAmtVal = amount.getText().toString().trim();
            double amtVal;
            //makes sure an expense is a double instead of a string
            if(stringAmtVal.isEmpty()){
                amtVal = 0;
            }else{
                amtVal = Double.parseDouble(stringAmtVal);
            }
            expense.setAmtSpent(amtVal);
            expense.setNote(note.getText().toString());
            expense.setReason(reason.getText().toString());
            expenseList.add(expense);

            //saves the data of the user
            saveDataExpenses();
            Intent intent = new Intent(getApplicationContext(), HomePage.class);
            startActivity(intent);
        });

private void saveDataExpenses() {
        SharedPreferences sharedPreferences = getSharedPreferences("myPreference", Context.MODE_PRIVATE);
        //sharedPreferences only allow for primitive times, so
        // we use json in order to jave objects like an array
        SharedPreferences.Editor editor = sharedPreferences.edit();
        Gson gson = new Gson();

        String jsonExpense = gson.toJson(expenseList);
        editor.putString("expenses", jsonExpense);
        editor.apply();
    }

Features

  • User authentication(in process...)
  • User data
  • visualized data
  • easy-to-use

Future Enhancements

  • Add more visual datasets
  • Improve User Interface
  • Deploy the project on a cloud service

Status

  • In Progress: Actively working on new features and improvements.

Challenges

Document any challenges faced during the project:

  • Handling user data over multiple activites
  • implemnting data sets like graphs
  • Having to transition to cloud service

Learnings

Highlight the key takeaways from the project:

  • Enhanced understanding of objects
  • Improved skills in debugging
  • Learned to use Json in order to store data
  • Learned about spinners in Android apps

Contributors

List all contributors involved in the project:

  • Daniel Ortega Jr - created the User Interface, as well as how the data is handled within the app

Contact

Feel free to reach out for collaboration, feedback, or questions.
Created by: [Daniel Ortega Jr]

Connect with me:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages