In today's fast-paced world, managing personal finances has become increasingly important for individuals and families. The ability to track and control one's expenses is vital for financial success and stability. This document discusses the development of a mobile application called Budget Tracker App which aims to provide users with an easy and efficient way to track and manage their expenses.
The idea for the Budget Tracker App emerged from the realization that many people often make purchases at stores, and then either bring receipts home or discard them immediately. This practice makes it challenging to keep track of expenses and can lead to financial disorganization.
The need for a mobile application that addresses this issue and provides a comprehensive solution for tracking expenses prompted the development of the Budget Tracker App.
- The application offers essential user functionality and is designed to serve as a personal financial assistant. It is particularly useful for those who frequently make purchases at stores and need a convenient way to record and monitor their spending habits.
- One of the most notable features of the Budget Tracker App is its ability to display the content of a receipt directly within the application.
- Users can easily add expenses or receipts, which are then stored in a transaction history and displayed in descending order by month.
The overall structure of the Budget Tracker App is designed to provide a user-friendly experience, featuring a straightforward Main Activity
with three primary options: Dashboard, Settings, and Exit. These options are easily accessible, allowing users to navigate effortlessly between them at any time.
- Dashboard: This serves as the central hub for managing receipts and monitoring expenses.
- Settings: Here, users can adjust their budget preferences and customize various aspects of the app to suit their needs.
This is the entry point of the application. It features three buttons: Dashboard, Settings, and Exit. The Dashboard button leads to the DashboardViewListActivity
, where users can view and manage their expenses. The Settings button leads to the SettingsEditActivity
where users can adjust their preferences.
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- The Dashboard button is implemented using an
Intent
that starts theDashboardViewListActivity
when the user clicks the button.
Button dashboardButton = findViewById(R.id.dashboard_button);
dashboardButton.setOnClickListener(v -> {
Intent intent = new Intent(MainActivity.this, DashboardViewListActivity.class);
startActivity(intent);
});
- The Settings button is implemented using an
Intent
that starts theSettingsEditActivity
when the user clicks the button.
Button settingsButton = findViewById(R.id.settings_button);
settingsButton.setOnClickListener(v -> {
Intent intent = new Intent(MainActivity.this, SettingsEditActivity.class);
startActivity(intent);
});
- The Exit button is implemented using the
finish()
andSystem.exit(0)
methods. This ensures that the application is completely closed when the user clicks the Exit button.
Button exitButton = findViewById(R.id.exit_button);
exitButton.setOnClickListener(v -> {
finish();
System.exit(0);
});
}
}
This activity manages the display of the expenses list. It utilizes a RecyclerView
for efficient display and scrolling of a large number of expense items. Additionally, a BarChart
is used to visualize the expenses. The expenses data is fetched from a DataHandler
object that interacts with the SQLite database.
public class DashboardViewListActivity extends AppCompatActivity {
private List<Expense> expenseList;
private RecyclerView recyclerView;
private BarChart barChart;
private DataHandler dbHandler;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard_expenses);
FloatingActionButton addExpenseButton = findViewById(R.id.add_expense_button);
addExpenseButton.setOnClickListener(this::addExpenses);
dbHandler = new DataHandler(this);
}
}
This class serves as the primary database interface for the app. The getAllExpenses()
method is used to fetch all the expenses from the database.
- The
getAllExpenses()
method is implemented using aCursor
object that iterates through the database and returns a list of all the expenses.
private Boolean setExpensesList() {
try {
dbHandler.open();
expenseList = dbHandler.getAllExpenses();
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
This component is invoked when users click the Add Expense button on the Dashboard. It captures the details of the new expense and saves it to the database.
public void addExpenses(View view) {
AddExpenseDialog.addExpense(this);
}
- Implement a feature to capture and save a picture of the receipt.
- Add a feature for exporting transaction history in CSV format.
- Include a section for tracking income, for a more comprehensive financial overview.
- Incorporate push notifications to remind users to update their expenses.
* | * |
---|---|
Platform | Android |
Language | Java |
Database | SQLite |
IDE | Android Studio |
We welcome contributions to the Budget Tracker App project. Please feel free to fork this repository, make changes in your local branch, and then submit a pull request.