Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 52

Notebook

Tia Hijaze
Expenses App
*Expenses*

Name: Tiya Hijaze

School: Albayan School

City: Tamra

ID number :

Teacher name: Eiad Mreh

Programming Language: java

Application of programming : Android Studio


Table of contents Page number
Background of the app 4
Research process 5-7
Key challenges 8-15
Special classes 16-25
Material components 26
User interface 27-46
UML ,‫ תרשים יוזמת הקלאסים‬46-47
Implementation 48
Manifest 49-50
Reflection & future 51-52
opportunities
The background of the app

1. The name of the project:

Expenses

2. A brief description of the project:

This project is made in Android Studio , in the language


Java, this app was made to make organising your
monthly expenses easier , the whole aim is to track your
daily expenses and what you spend during your day or
week or month and then comparing them side by side ,
its aim is to prevent overspending on specific topics like
food or games , and making people more aware about
what they spend.
So basically an organiser for your expenses.

3. The appropriate Audience for the project :

The specified audience for this app is from people as


young as 16 and older, where any younger than that and
I don't feel like that is an appropriate age for being
concerned about what you spend your money on ,
because usually then their parents take care of their
money and their expenses.
So this app basically is for the users that are old enough
to maybe have a wage and a good income that they
want to track their spendings and get to a point where
they don’t make mistakes when spending their money.

4. Reasons why i chose this topic/project :

I chose this project because two years ago I started


working when I entered highschool and since I am
working a few days a week I had a regular income and I
was happy at first ,like who wouldn’t be happy to have
an income when you are young? I could buy anything I
wanted from my own money , but a few months later I
felt a void in my heart , I felt that I was overspending , I
felt like a little kid being irresponsible due to me
overspending my own money .
And when i heard at the beginning of the year 12 in
school that we are going to do an app project , a bulb
powered on in my mind , why wouldn’t i make an app for
organising your spending , so i went with the idea and i
made this app to be an organiser for your monthly
expenses and it sums things up in a way that you see
them all together.
The Research Process :

Research on the field of knowledge:

To develop a successful app, it is important to have a


good understanding of the field of knowledge that the
app is based on. In this case, the field of knowledge is
expenses. I conducted extensive research on apps that
are for spending money,this meant that i had to look at a
lot of banks applications or apps that offered money
spending features including their functionalities like,
payment organisers, and adding expenses.

Apps in the market :

Field work: i conducted a review of the current situation


in the market to identify similar applications and what
innovations could be added to the project. The review
showed that there were several e-commerce apps
available in the market, including apps that specialise in
organising your sales and what you buy ,where i found
this similar app to my idea ,it's called good budget
Where i found this app that has a similar objective as
mine
Where I am seeing that they organise what you bought
in a special way and I aim to do the same , as I took this
app for reference.

So what does my app offer ?

My app is special in a way that it's going to bring an


advanced UI design that will have a good integrating
system and it will organise whatever you put in as
something you spent your money on.
Key challenges

Whilst doing the project i had a few difficulties ,i will go


through them below:

1- During the development of my Expenses app, I faced


several challenges. One of the primary challenges was
to ensure that the application was user-friendly and easy
to navigate, particularly for users who may not be tech-
savvy. I wanted to make sure that the users could
quickly add things they spent their money on very
easily , and compare expenses in an all in one view .

So what did I do ?
After I learned the basics with our teachers , I still felt
that I could learn more about designing and UI as a
whole , as I have a hobby of drawing on paper and on
an ipad so I wanted to design things in a proper way.

I first went on to the internet , and then i started


searching for ways to help me out to get a good design
for the xml

And as i was doing it i came across the website


Android Developers , and on this website i found all the
required information that i needed there
https://developer.android.com/reference/android/util/Xml

As i got information on the different options that are


available for the layouts as in
For constraint layout where you have to constraint things
, or linear layout or relative layout , or even FrameLayout
that are for fragments.
And I learnt about textviews and edittexts and cardviews
and bottom navigation bar , buttons and other things as
well.

2-Another challenge I encountered was integrating


different technologies to ensure scalability and maintain
security. I wanted to make sure that my app could
handle a large number of users without any lags or
crashes. I also made sure to implement robust security
measures to protect the user's personal and payment
information.
One area where I faced particular difficulties was
programming for Firebase. As I had limited experience
with Firebase, I had to rely on various resources, such
as online tutorials, to overcome these challenges. For
example, I needed a method that would allow us to
connect an online database to the app effectively. This
involved learning the CRUD operations (Create, Read,
Update, Delete) that Firebase provides, allowing users
to create, read, update, and delete data in real-time.
I learned that on tutorials on youtube from a variety of
channels , here is the main channel that i learned from :
https://www.youtube.com/watch?
v=faFEw4JQdbw&list=PLs1bCj3TvmWmC4WsOGQiw9
7o_zNNyusAz
This video and the channel Provide with a list of videos
that teaches CRUD

I utilised an extensive tutorial series on YouTube, which


led me through the process step-by-step. The tutorial
series was particularly helpful in teaching me how to use
Firestore, which is a cloud-based NoSQL document
database used by Firebase. We included the following
dependencies in our project to utilise Firebase and
Firestore:

● implementation 'com.google.firebase:firebase-firestore:24.4.4'
● implementation 'com.google.firebase:firebase-auth:21.1.0'

After integrating Firebase into the Expenses app, I


worked on the physical database online through our
browser. I used RealTime Database to create the
database, which allowed me to store and retrieve data in
real-time. I was able to display all the expenses the user
puts into their account and then be displayed so edit and
read.
Here is a photo demonstrating what it looks like in
RealTime Database:
Where as you see there is two collections in the
RealTime Database ,

“Categories” , where this in the app shows the available


categories for the user so they can relate the thing they
spent their money on into a category .
For example if you let's say buy a pizza on a friday night
with your friends and family you will put that into the
category food. And so on and so forth…

And then we have the collection :


“Users” , where once you make a new account and
become a user you will have your account registered in
the user collection and you can update things like user
name and your profile picture and the phone number.

3- I also had a hard time figuring out how to do the


notification
I didn’t know how to do the notification , i had to search
online and i ended up with help form this video tutorial
on youtube
https://youtu.be/4BuRMScaaI4
And basically let me end up with this code for the
notification
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationManager notificationManager =
getSystemService(NotificationManager.class);
NotificationChannel channel =
notificationManager.getNotificationChannel("my_channel_id1");
if (channel == null) {
// Create notification channel if it does not exist
channel = new NotificationChannel("my_channel_id1", "My Channel",
NotificationManager.IMPORTANCE_HIGH);
channel.setDescription("This is my notification channel");
notificationManager.createNotificationChannel(channel);
} else if (channel.getImportance() ==
NotificationManager.IMPORTANCE_NONE) {
Intent intent = new
Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, channel.getId());
startActivity(intent);
}
}

NotificationManager notificationManager = (NotificationManager)


getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = new
NotificationCompat.Builder(Online_Payment.this, "my_channel_id1")
.setContentTitle("Expenses")
.setContentText("Thank you for your notice")
.setSmallIcon(R.drawable.ic_new);
notificationManager.notify(1, builder.build());
Log.d("Notification", "Notification created successfully!");

In the end the notification wasn’t that big of a deal , it


was actually fun learning it .

4- i wanted to have in my app a bottom navigation bar,


but i had difficulties with integrating the bottom
navigation view , as i wanted to make seamless
experience of moving between the fragments
And now as to the bottom navigation i used help from
online sources
From geeks for geeks
On this link : https://www.geeksforgeeks.org/bottom-
navigation-bar-in-android/

And this is what i ended up with

What does the app answer?

This app offers a way to organise your expenses and


your daily payments in one place so that you can
organise and see your payments all together.
Things that i need to explain so that i can show more
details in the special classes section

1. **Adapters:**
Adapters are essential components in Android that
help connect data sources (like Firebase Firestore or
Firebase Realtime Database) to UI elements such as
RecyclerViews or ListViews. Here's why we use
adapters:
- **Data Binding:** Adapters bind data from Firebase
to individual UI elements in a list or grid.
- **Efficient Rendering:** Adapters handle the
recycling of views in RecyclerViews, improving
performance by reusing existing views instead of
creating new ones.
- **Customization:** Adapters allow customization of
how data is displayed in each item of a list or grid.

2. **Models:**
Models, often referred to as POJOs (Plain Old Java
Objects) or data classes, represent the structure of data
retrieved from Firebase. Here's why models are
important:
- **Data Structure:** Models define the structure of
each item of data, including its fields and types (e.g.,
strings, numbers, dates).
- **Mapping Data:** Models help map Firebase
documents or nodes to Java/Kotlin objects, making it
easier to work with data in the app.
- **Encapsulation:** Models encapsulate data and
provide methods to access and manipulate it, following
object-oriented principles.

3. **XML Layout Items:**


XML layout items define the visual appearance and
structure of individual items in a RecyclerView or
ListView. Here's why we create XML layout items:
- **UI Design:** XML layout items define how each
item in the list/grid should look, including views like
TextViews, ImageViews, etc.
- **Separation of Concerns:** Separating UI layout in
XML files keeps the code clean and maintains a clear
separation between UI design and logic.
- **Reuse:** XML layout items can be reused across
different parts of the app, promoting consistency in UI
design.

When retrieving data from Firebase, the workflow


typically involves:
1. **Data Retrieval:** Using Firebase APIs (Firestore,
Realtime Database) to fetch data, which is often done
asynchronously.
2. **Data Mapping:** Mapping the retrieved data to
model objects (POJOs) that represent the structure of
the data.
3. **Adapter Setup:** Configuring an adapter (like
FirebaseRecyclerAdapter for Firestore or custom
adapters for Realtime Database) to bind the data to UI
elements.
4. **UI Display:** Inflating XML layout items within the
adapter to display each item's data in RecyclerViews or
ListViews.

SPECIAL CLASSES

In my application project i used special classes , so after


i explained the relationship between models and
adapters and xml items , i will show these classes and
explain things

Category adapter :
public class CategoryAdapter extends
RecyclerView.Adapter<RecyclerView.ViewHolder> {
private Context context;
private ArrayList<UserCategoryBoundary> categories;
private OnClickCategory onClickCategory;

public CategoryAdapter(Context context, ArrayList<UserCategoryBoundary>


categories){
this.categories = categories;
this.context = context;
}

@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup
parent, int viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.category_item,
parent, false);
return new CategoryViewHolder(view);
}

@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder,
int position) {
CategoryViewHolder categoryViewHolder = (CategoryViewHolder) holder;
UserCategoryBoundary categoryBoundary = getItem(position);

categoryViewHolder.category_TV_name.setText(categoryBoundary.getCategoryEnt
ity().getName());
Glide.with(context)
.load(categoryBoundary.getCategoryEntity().getImageUrl())
.into(categoryViewHolder.category_IMG_image);

categoryViewHolder.category_TV_total.setText(categoryBoundary.getTotalPrice
() + " ₪");

double percent = categoryBoundary.getTotalPrice() /


categoryBoundary.getMaxPrice();

if (percent > 1){


categoryViewHolder.category_PI_progress.setProgress(100);
}else{
// percent * 100
int value = (int) Math.round(percent * 100);
categoryViewHolder.category_PI_progress.setProgress(value);
}
}

private UserCategoryBoundary getItem(int position) {


return categories.get(position);
}

@Override
public int getItemCount() {
return this.categories.size();
}

public void setOnClickCategory(OnClickCategory onClickCategory){


this.onClickCategory = onClickCategory;
}

public class CategoryViewHolder extends RecyclerView.ViewHolder {

public ImageView category_IMG_image;


public TextView category_TV_name;
public LinearProgressIndicator category_PI_progress;
public TextView category_TV_total;

public CategoryViewHolder(@NonNull View itemView) {


super(itemView);

category_IMG_image =
itemView.findViewById(R.id.category_IMG_image);
category_TV_name = itemView.findViewById(R.id.category_TV_name);
category_PI_progress =
itemView.findViewById(R.id.category_PI_progress);
category_TV_total =
itemView.findViewById(R.id.category_TV_total);

itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
UserCategoryBoundary categoryBoundary =
getItem(getAdapterPosition());
int position = getAdapterPosition();
onClickCategory.onClick(categoryBoundary, position);
}
});

}
}
}

Category model (category entity):


CategoryEntity extends FirebaseKey implements Serializable {
public static final String CATEGORY_TABLE = "Categories";
private String name;
private String imagePath;
private String imageUrl;

public CategoryEntity(String name, String image) {


this.name = name;
this.imagePath = image;
}

public CategoryEntity(){}

public String getName() {


return name;
}

public CategoryEntity setName(String name) {


this.name = name;
return this;
}

public String getImagePath() {


return imagePath;
}

public CategoryEntity setImagePath(String image) {


this.imagePath = image;
return this;
}
@Exclude
public String getImageUrl(){
return this.imageUrl;
}

public CategoryEntity setImageUrl(String imageUrl){


this.imageUrl = imageUrl ;
return this;
}

public String toString(){


return this.name;
}

Category item :

As i described above , why we need all three to work


together and bind them so that we can get the data back
from the category collection in the RealTime Database
And now onto to product section :

Product adapter :
public class ProductAdapter extends
RecyclerView.Adapter<RecyclerView.ViewHolder>{
private Context context;
private List<CategoryItem> categoryItems;

public ProductAdapter(Context context, List<CategoryItem> categoryItems)


{
this.context = context;
this.categoryItems = categoryItems;
}

@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup
parent, int viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.product_item,
parent, false);
return new ProductAdapter.ProductViewHolder(view);
}

@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder,
int position) {
ProductAdapter.ProductViewHolder productViewHolder =
(ProductAdapter.ProductViewHolder) holder;
CategoryItem categoryItem = getItem(position);

productViewHolder.product_TV_name.setText(categoryItem.getTitle());
productViewHolder.product_TV_price.setText(categoryItem.getPrice() +
" ₪");
}

public CategoryItem getItem(int position){


return this.categoryItems.get(position);
}
@Override
public int getItemCount() {
return categoryItems.size();
}

public class ProductViewHolder extends RecyclerView.ViewHolder {

public TextView product_TV_name;


public TextView product_TV_price;
public ProductViewHolder(@NonNull View itemView) {
super(itemView);
product_TV_price = itemView.findViewById(R.id.product_TV_price);
product_TV_name = itemView.findViewById(R.id.product_TV_name);

}
}
}

Category item (model) :

package com.example.expensesapp.entity;

import java.io.Serializable;
import java.util.Date;

public class CategoryItem implements Serializable {

private String title;


private double price;
private Date date;

public CategoryItem() {
this.date = new Date();
}
public String getTitle() {
return title;
}

public CategoryItem setTitle(String title) {


this.title = title;
return this;
}

public double getPrice() {


return price;
}

public CategoryItem setPrice(double price) {


this.price = price;
return this;
}

public Date getDate() {


return date;
}

public CategoryItem setDate(Date d){


this.date = d;
return this;
}
}

Xml item - product item :

And they all work together so that they can get all the
details from a specified category to see what products
their money was spent on.
I also have organised the classes in my application very
well
Look at the organising

Where in each folder there is classes that i use and


organise in a proper way

Where in auth i used this to help me with callbacks that


help me get authorization to log in

package com.example.expensesapp.auth;

public class AuthUser {


private String email;
private String password;

public AuthUser(){}
public AuthUser(String email, String password){
this.email = email;
this.password = password;
}
public String getEmail() {
return email;
}

public AuthUser setEmail(String email) {


this.email = email;
return this;
}

public String getPassword() {


return password;
}

public AuthUser setPassword(String password) {


this.password = password;
return this;
}
}

Auth controller :
package com.example.expensesapp.controller;

import androidx.annotation.NonNull;

import com.example.expensesapp.auth.AuthUser;
import com.example.expensesapp.callback.AuthCallBack;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;

public class AuthController {


private FirebaseAuth mAuth;
private AuthCallBack authCallBack;

public AuthController() {
this.mAuth = FirebaseAuth.getInstance();
}

public void setAuthCallBack(AuthCallBack authCallBack){


this.authCallBack = authCallBack;
}

public void login(AuthUser authUser){


this.mAuth.signInWithEmailAndPassword(authUser.getEmail(),
authUser.getPassword())
.addOnCompleteListener(new OnCompleteListener<AuthResult>()
{
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
authCallBack.onLoginComplete(task);
}
});
}

public void createAccount(AuthUser authUser){


this.mAuth.createUserWithEmailAndPassword(authUser.getEmail(),
authUser.getPassword())
.addOnCompleteListener(new OnCompleteListener<AuthResult>()
{
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
authCallBack.onCreateAccountComplete(task);
}
});
}

public FirebaseUser getCurrentUser(){


return mAuth.getCurrentUser();
}

public void logout(){


mAuth.signOut();
}

public void sendResetPasswordLink(String email){


mAuth.sendPasswordResetEmail(email);
}
}

Where this two classes help me out to sign in with


classes that I can call in the log in and sign up .
Material components :
The used built in components for the user :
1)Button
2)Edittext
3)Menu (Bottom Navigation Bar)
4)Textview
5)Imageview
6)RecyclerView
7)Spinner
8)progress bar
9)CardView
User Interface
Here is the user interface and how to use the
application :

For the logo of the app i got this picture from


online , as i have found it
Now lets begin with our first activity:
We begin with Register activity

Here is how it looks :


Where you create an account here , after you fill in all
the details you can create an account with firebase
authentication
Here is some code for creating a new user

signup_BTN_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String email =
signup_TF_email.getEditText().getText().toString();
String password =
signup_TF_password.getEditText().getText().toString();

if(!checkInput()){
Toast.makeText(SignupActivity.this, "Please check your
inputs!", Toast.LENGTH_SHORT).show();
return;
}

AuthUser authUser = new AuthUser(email, password);


authController.createAccount(authUser);
signup_PB_loading.setVisibility(View.VISIBLE);

}
});

public void createAccount(AuthUser authUser){


this.mAuth.createUserWithEmailAndPassword(authUser.getEmail(),
authUser.getPassword())
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
authCallBack.onCreateAccountComplete(task);
}
});
}

And then after the sign up activity , we go to the login


activity :
And here is how it looks
And here we check if the user is a current user in the
firebase authentication
And here is the code for checking that
public void login(AuthUser authUser){
this.mAuth.signInWithEmailAndPassword(authUser.getEmail(),
authUser.getPassword())
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
authCallBack.onLoginComplete(task);
}
});
}

And we also have the eye icon vector asset , and its
objective is so that we can get to see the password or
unsee it if we want

And after that we go to the HomeActivity

And this the home activity


And in its xml i use a frame layout so i can put different
views together from the fragment
Where home activity has the ability to transfer between
3 fragments

1- home fragment
2- update fragment
3- profile fragment

And in home activity we make a fragment manager that


once clicked on an item in the bottom navigation bar it
changes view in the frame layout that is in the xml

Here is the code of changing view in fragment and their


listeners
private void initVars() {
// FragmentManager fragmentManager = getSupportFragmentManager();

HomeFragment homeFragment = new HomeFragment(this);

getSupportFragmentManager().beginTransaction().add(R.id.home_FL_home,
homeFragment).commit();

ProfileFragment profileFragment = new ProfileFragment(this);

getSupportFragmentManager().beginTransaction().add(R.id.home_FL_profile,
profileFragment).commit();

UpdateFragment updateFragment = new UpdateFragment(this);

getSupportFragmentManager().beginTransaction().add(R.id.home_FL_update,
updateFragment).commit();

home_FL_profile.setVisibility(View.INVISIBLE);
home_FL_update.setVisibility(View.INVISIBLE);

home_BN.setOnItemSelectedListener(new
NavigationBarView.OnItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item)
{

if(item.getItemId() == R.id.home){
// home
home_FL_profile.setVisibility(View.INVISIBLE);
home_FL_update.setVisibility(View.INVISIBLE);
home_FL_home.setVisibility(View.VISIBLE);
}else if (item.getItemId() == R.id.profile){
//profile
home_FL_profile.setVisibility(View.VISIBLE);
home_FL_update.setVisibility(View.INVISIBLE);
home_FL_home.setVisibility(View.INVISIBLE);
}else {
// update
home_FL_profile.setVisibility(View.INVISIBLE);
home_FL_update.setVisibility(View.VISIBLE);
home_FL_home.setVisibility(View.INVISIBLE);
}

return true;
}
});

Now lets go to the update fragment:

Here is how it looks


Where this is where you add what you have spent your
money
Lets say you want to add a food that you have ordered,
so you click on the spinner and it will reveal a few
options of the categories available
And here is how it would look like
So after you fill in the title and the price
You click on the button add , and once you click on it , it
will add your expense or spending to the real time
database so we can retrieve it later , and the saving is
done using the model i have already explained about in
the special classes

, and here i will show you the code that will save the
data .
private void addItemToCategory(){

String uid = authController.getCurrentUser().getUid();


String title = fUpdate_TF_title.getEditText().getText().toString();
double price =
Double.parseDouble(fUpdate_TF_price.getEditText().getText().toString());
CategoryEntity categoryEntity = (CategoryEntity)
fUpdate_SP_categoriesList.getSelectedItem();

CategoryItem categoryItem = new CategoryItem()


.setPrice(price)
.setTitle(title);

boolean found = false;

for(UserCategory userCategory : USER_CATEGORIES){


// add item to existing category
if(categoryEntity.getKey().equals(userCategory.getCategoryKey())){
userCategory.addItem(categoryItem);
categoryController.updateCategoryItems(uid, userCategory);
found = true;
break;
}
}
// new category
if(!found){
UserCategory userCategory = new UserCategory();
userCategory.setMaxPrice(1000);
userCategory.setCategoryKey(categoryEntity.getKey());
userCategory.addItem(categoryItem);
categoryController.updateCategoryItems(uid, userCategory);
}

And now lets go back to the home fragment


After you have saved an expense in your update
fragment it will be saved in the real time database , and
basically here in this home fragment we retrieve what
was saved their

And here is how it would look like

Home fragment
Where we first see the categories of what we have spent
our money upon, and then we see the represented
photo that i have already put in the firebase storage
For the specified category option . and then on the right
we see a number and that adds up all of the money that
was spent on that specific category
And if you click on it it will retrieve the data of all the
saved expenses from that specified category and show
them
From getting help from recyclerview and the product
item in the xml

And here is how it would look for all the expenses spent
on a specified category
And as you basically see the price at the top shows all
the sum of the expenses , and at the top we see the
category option
The limit for the category spendings are 1000 , and once
you exceed the thousand you will see the progress bar
being over populated and filled up to the brink.

And now you go to the profile fragment and here is how


it looks :
Where at the top we see the email and the username of
the current user

And at the bottom its pretty self explanatory , if you click


on logout it will take you out of the application
If you click on the dashboard

Which is basically a control room , that will show all the


categories of the expenses here in one place , and here
is how it would look like
You can click on them and see the details as well

, and then we come to the option to select edit account

, once you click on it it will take you to an account


activity and here how it would look like
Where once you come here it gives you the opportunity
to change your first and last name and at the very top is
a camera button where once you clicked on it and if you
have permission it will open the camera for you , so that
you can take a picture.
And here is the code for getting camera permission
public boolean checkPermissions() {
return (ContextCompat.checkSelfPermission(
this,
Manifest.permission.CAMERA
) == PackageManager.PERMISSION_GRANTED);
}

private void requestPermissions() {


ActivityCompat.requestPermissions(
this,
new String[]{
Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE
},
100
);
}

And then it will update your profile picture and once you
log in once again to the profile fragment you will see
your profile picture updated and present

, and yes that basically concludes all of the user


interface.
UML for my application

:‫תרשים יוזמת הכלאסים‬


Login
Sign up

Home activity

Profile fragment Update fragment Home


fragment

editProfile dashboard

Now here is the implementation i used :


Implementation:
{ plugins
'id 'com.android.application
'id 'com.google.gms.google-services
}

{ android
'namespace 'com.example.expensesapp
compileSdk 33

{ defaultConfig
"applicationId "com.example.expensesapp
minSdk 24
targetSdk 33
versionCode 1
"versionName "1.0

"testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner
}

{ buildTypes
{ release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-
'optimize.txt'), 'proguard-rules.pro
}
}
{ compileOptions
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

{ dependencies
implementation platform('com.google.firebase:firebase-bom:32.6.0')
'implementation 'com.github.bumptech.glide:glide:4.16.0
"implementation "com.google.firebase:firebase-auth
"implementation "com.google.firebase:firebase-database
"implementation "com.google.firebase:firebase-storage
'implementation 'de.hdodenhof:circleimageview:3.1.0
'implementation 'androidx.appcompat:appcompat:1.6.1
'implementation 'com.google.android.material:material:1.8.0
'implementation 'androidx.constraintlayout:constraintlayout:2.1.4
'testImplementation 'junit:junit:4.13.2
'androidTestImplementation 'androidx.test.ext:junit:1.1.5
'androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1

Here is the Manifest :


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />


<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera" />

<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher_icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_icon_round"
android:supportsRtl="false"
android:theme="@style/Theme.ExpensesApp"
tools:targetApi="31">
<activity
android:name=".main.CompareCategoryActivity"
android:exported="false" />
<activity
android:name=".main.DashboardActivity"
android:exported="false" />
<activity
android:name=".main.UpdateProfileActivity"
android:exported="false" />
<activity
android:name=".main.CategoryActivity"
android:exported="false" />
<activity
android:name=".main.HomeActivity"
android:exported="false" />
<activity
android:name=".auth.SignupActivity"
android:exported="false" />
<activity
android:name=".auth.LoginActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


</intent-filter>
</activity>
</application>
</manifest>

Future opportunities :

I feel that this is just the beginning for the app , as at the
moment it is an organiser for what you spend your
money on , and i want that in the future i add an option
to add credit card information just like apple pay , so that
you can pay with the app , and that if you cross the limit
of what you allowed for yourself , you can’t then spend
that money , i feel like younger people who might feel
unorganised when managing money will benefit the
most from this app , and i am really excited to represent
this project.

Reflection:
Reflection :
Completing the managing Expenses app project was an
incredible achievement for me. It was a project that challenged
me in many ways, and required a lot of hard work, dedication,
and persistence.

I am proud to have developed an app that meets the needs of


users who are looking for a user-friendly platform to manage
their spending for daily life expenses. I was able to integrate
Firebase authentication to ensure users' data is secure and
protected.

Throughout the project, I faced various challenges, such as


ensuring the app was user-friendly, integrating different
technologies, ensuring scalability, and maintaining security.
Working with Firebase was particularly challenging due to my
limited experience with it, but I was able to overcome these
challenges by using various resources such as geeksforgeeks,
Android developers' websites, and YouTube tutorials.

Completing the project was a mix of emotions, such as relief,


pride, and joy. It's an incredible feeling to see the end product
of all the hard work and effort that went into it. This project is a
testament to my skills, knowledge, and dedication to the craft of
app development.

Overall, completing the managing Expenses app project was


an excellent accomplishment for me, and it has given me the
confidence to take on more advanced projects in the future.

You might also like