Momentum is a budget tracking Android application which has different features including adding expenses based on categories such as food or others, allowing the users to stock all their monthly expenses. The users are also able to see their expenses one by one, as well as the total expenses for each category and the total spent during the month. By putting thresholds, real-time elapsed and counting the time spent in the app, the users can have a better own financial control.
The app also encourages the user to add their expenses daily by sending notifications to different hours during the day and has functionalities regarding the airplane mode is on and off. The user can restore the monthly budget every time it is needed, on salary day or by their own judgement.
Having control of our budget can improve our lifestyles, therefore using Momentum provides the perfect workplace for this.
-
Expense Management:
- Add expenses with detailed information, including name, amount, and category (Food, Others).
- Store expenses persistently using
SharedPreferences. - View categorized and summarized expenses, including totals for each category and the remaining budget.
- Share expense summaries via social apps and reset all expenses when required.
-
App Usage Monitoring:
- Tracks and logs the time spent within the app in real-time.
- Provides elapsed time data on the main screen, updated every second.
- Stops tracking when the app is closed or removed from recent apps.
-
Notifications and Reminders:
- Sends notifications to remind users to log their expenses three times a day (10:00 AM, 4:00 PM, 8:00 PM).
- Real-time notifications for elapsed time while the app is running.
-
System and Custom Broadcasts:
- Responds to airplane mode changes to adjust app functionality dynamically.
- Allows custom broadcasts with app-specific actions.
-
MainActivity- Purpose: Acts as the main entry point for the app.
- Key Features:
- Allows users to navigate to the Add Expense or View Expenses screens.
- Sets daily alarms for notifications using
AlarmManager. - Binds to the
TaskMonitoringServiceto display elapsed time in real-time. - Handles custom broadcast sending and airplane mode status updates.
-
AddExpenseActivity- Purpose: Allows users to input and save their expenses.
- Key Features:
- Collects expense details such as name, amount, and category.
- Validates inputs to ensure data accuracy.
- Saves expense data in
SharedPreferencesas a JSON array.
-
ViewExpensesActivity- Purpose: Displays all recorded expenses and summary data.
- Key Features:
- Categorizes and sums expenses into totals for Food and Others.
- Shows the remaining budget based on a preset monthly budget.
- Allows sharing expense summaries via external apps.
- Provides a back button to return to the main screen.
-
BackgroundCounterService- Purpose: Tracks the total time spent within the app.
- Key Features:
- Starts as a foreground service to ensure consistent monitoring.
- Updates a persistent notification with the elapsed time.
- Stops tracking and logs the total time when the app is closed or removed.
-
BudgetTrackerService- Purpose: Sends periodic reminders to log expenses.
- Key Features:
- Runs as a foreground service with high-priority notifications.
- Reminds users at fixed times daily using the
AlarmManager.
-
TaskMonitoringService- Purpose: Monitors specific task durations within the app.
- Key Features:
- Provides a
LocalBinderfor activities to interact with the service. - Tracks elapsed time for user-defined tasks and updates notifications in real-time.
- Saves and restores task monitoring states using
SharedPreferences.
- Provides a
-
AlarmReceiver- Purpose: Handles alarm events to send expense reminders.
- Key Features:
- Receives alarms set by
AlarmManagerand triggers theBudgetTrackerServiceto send notifications. - Logs when alarms are received for debugging purposes.
- Receives alarms set by
-
MyBroadcastReceiver- Purpose: Handles custom broadcasts sent by the app.
- Key Features:
- Displays messages received via custom intents using toast notifications.
-
Airplane Mode Receiver (Implemented in
MainActivity)- Purpose: Listens for airplane mode changes.
- Key Features:
- Dynamically updates app functionality (e.g., disabling broadcast sending).
-
SharedPreferences- Used extensively to store:
- Expense data as a JSON array.
- Task monitoring states, including monitoring status and start time.
- Ensures data persistence even when the app is closed.
- Used extensively to store:
-
Alarms
- Set using the
AlarmManagerto trigger notifications at predefined times daily.
- Set using the
-
Notifications
- Implemented with
NotificationChannelto ensure compatibility with Android O+ devices. - Used in
BackgroundCounterService,BudgetTrackerService, andTaskMonitoringService.
- Implemented with
-
Threads and Handlers
Handleris used inTaskMonitoringServiceto update notifications in real-time.- A separate thread is used in
BackgroundCounterServiceto calculate elapsed time without blocking the main thread.
- Open the app to access the main menu.
- Add expenses using the Add Expense button. Enter the expense name, amount, and category, then save it.
- View detailed expense summaries by selecting the View Expenses option. Check categorized totals and share summaries if needed.
- Monitor app usage time on the main screen, with real-time updates displayed at the top.
- Reset all expenses monthly or as needed using the Reset Monthly button.