AMCA Individual Assignment-Book4Sport
AMCA Individual Assignment-Book4Sport
INDIVIDUAL ASSIGNMENT
TECHNOLOGY PARK MALAYSIA
CT100-3-3-AMCA
ADVANCED MOBILE COMPUTING WITH ANDROID
Student ID TP042306
1
CT100-3-3-AMCA Advanced Mobile Computing with Android
Table of Contents
1.0 Introduction ................................................................................................................................. 3
1.1 Introduction to System .................................................................................................................. 3
1.2 System Description ....................................................................................................................... 3
1.3 Platform Version Selection ........................................................................................................... 4
2.0 Functionalities ................................................................................................................................... 4
3.0 System Design .................................................................................................................................. 5
3.1 Logical Design .............................................................................................................................. 5
3.1.1 Use Case Diagram.................................................................................................................. 5
3.1.2 State Machine Diagram .......................................................................................................... 6
3.2 Physical Design ............................................................................................................................. 7
3.3 Technologies Used ........................................................................................................................ 9
3.3.1 Android Studio ....................................................................................................................... 9
3.3.2 Java ........................................................................................................................................ 9
3.3.3 Cloud Firestore....................................................................................................................... 9
3.3.4 HTML, CSS, JavaScript....................................................................................................... 10
3.3.5 Firebase Robo Test............................................................................................................... 10
3.3.6 Google Map View .................................................................................................................... 11
4.0 Code Implementation ...................................................................................................................... 12
4.1 Firestore ...................................................................................................................................... 12
4.1.1 Add Data .............................................................................................................................. 12
4.1.2 Read Data ............................................................................................................................. 13
4.1.3 Delete Data........................................................................................................................... 13
4.1.4 Authentication - Login ......................................................................................................... 14
4.1.5 Authentication – Sign Up ..................................................................................................... 14
4.2 Butter Knife ................................................................................................................................ 15
4.3 Picasso (Loading Image) ............................................................................................................. 15
4.4 Espresso Test .............................................................................................................................. 16
4.5 Google Map View ....................................................................................................................... 16
5.0 User Interface .................................................................................................................................. 17
5.1 Mobile Application ..................................................................................................................... 17
5.2 Web Application ......................................................................................................................... 26
6.0 Conclusion ...................................................................................................................................... 29
7.0 References ....................................................................................................................................... 30
2
CT100-3-3-AMCA Advanced Mobile Computing with Android
1.0 Introduction
1.1 Introduction to System
Book4Sport is a sport facility booking application which allows users to book for the
sport facilities like basketball court, badminton court, football court, swimming pool and so on.
This application aims to provide a platform for people who love sports to book a proper sport
complex or facilities. Book4Sport also aims to promote sports among the people, so more and
more sport enthusiasts can have a sport facility with better condition. The users will able to
look for the sport facilities with different type of sports and make booking for the selected sport
facility.
3
CT100-3-3-AMCA Advanced Mobile Computing with Android
According to Figure 1.1 above, there are not more than 1% of the devices running on
the platform below the version 4.1x, so the Jelly Bean with API level 16 is chosen as the
minimum version of the application development. Therefore, the device with the lower version
than Jelly Bean will not able to run the application as the version will not be supported in
Book4Sport mobile application.
2.0 Functionalities
This purpose of this project is to implement a Sport Facility Booking Mobile
Application with the intent of allowing the sport enthusiasts to book the sport facilities. There
are some functionalities available in this mobile application:
Allow the users to register with the email in order to access the application.
Allow the users to search for the sport facilities with the type of sports and location.
Allow the users to make booking for the sport facilities with specific date.
Allow the users to view the booking history.
Allow the users to update and delete the booking information.
Allow the admin to create, read, update, delete and search (CRUDS) the user
information and the sport facilities information.
4
CT100-3-3-AMCA Advanced Mobile Computing with Android
5
CT100-3-3-AMCA Advanced Mobile Computing with Android
6
CT100-3-3-AMCA Advanced Mobile Computing with Android
7
CT100-3-3-AMCA Advanced Mobile Computing with Android
8
CT100-3-3-AMCA Advanced Mobile Computing with Android
3.3.2 Java
Java is a cross-platform object-oriented programming language developed by Sun
Microsystems in 1995 which is platform independent and can be used to develop Android
application, server application, web application, websites and so on. There are two
programming language in Android Studio. The reason of choosing Java for this mobile
application development is because it is object-oriented which allows developer to create
modular programs make the code reusable. Other than that, Java is more popular currently
compared to Kotlin which is new to the market, so the community support for Java is stronger
as there are many active forums which provide solutions and discussion on specific problem
(Javarevisited, 2019). For example, Stack Overflow and GitHub are one of the best
communities which the developers will share their knowledge to the community.
9
CT100-3-3-AMCA Advanced Mobile Computing with Android
10
CT100-3-3-AMCA Advanced Mobile Computing with Android
11
CT100-3-3-AMCA Advanced Mobile Computing with Android
To add data into Firestore, DocumentReference is initialized which point to the specific
collection and add new document with specific ID. In Figure 4.1 above, “set” method is used
to overwrite the data in the specific document.
12
CT100-3-3-AMCA Advanced Mobile Computing with Android
13
CT100-3-3-AMCA Advanced Mobile Computing with Android
In Figure 4.3, the document path is set into dbBooking and specific document in
specific collection will be deleted by using “delete” method. Once the deletion is successful, a
message will be showed to the users.
Firebase provided an Authentication SDK called FireAuth which is used to login the
user with their email and password. In Figure 4.4, signInwithEmailAndPassword method is
called to check whether the user email and password match the user record in Firebase
Authentication, the user will navigate to the Home page.
14
CT100-3-3-AMCA Advanced Mobile Computing with Android
With the help of Butter Knife, a more effective and efficient approach is provided for
developers. By using Butter Knife, the boilerplate code can be reduced. In Figure 4.6 above,
@BindView is used to bind the variables to specific view id.
15
CT100-3-3-AMCA Advanced Mobile Computing with Android
Espresso testing allows the developers to write a reliable UI tests which can save the
time for conducting test for a function. Figure 4.8 above shows a testing on a login activity
which the espresso will input the email and password in the specific editText field and click
the login button.
Google map view is an interactive view that shows the map of specific location an place
a marker on the map. In Figure 4.9 above, a specific latitude and longitude will be pass into the
“addMarker” method along with the title of the selected sport facility.
16
CT100-3-3-AMCA Advanced Mobile Computing with Android
In the Login page, if user is registered, they will only need to enter the email, password
and click login button to login to the application. If user I not registered, user can click the
“Don’t have account?” text to proceed to registration.
17
CT100-3-3-AMCA Advanced Mobile Computing with Android
Sign Up Page
In Sign Up page, if user is not registered, user can enter their email, username and
password then click sign up button to sign up as a new user then user will be navigated to Home
page. If user already have an account, user can simply click on the “Already have an account?”
text to proceed to Login page.
18
CT100-3-3-AMCA Advanced Mobile Computing with Android
Home Page
In Home page, two button and a look book will be showed. User can click on the three-line
button on the menu bar and the navigation drawer will be showed. Those two buttons in the
Home page will navigate the user to specific page such as Booking page and History page. The
look book only shows some quotes for the user for motivation purpose.
19
CT100-3-3-AMCA Advanced Mobile Computing with Android
Navigation Drawer
In the Navigation Drawer, the username and email will be showed. There will be three
buttons in the navigation drawer which will navigate the user to specific page such as Home
page, Booking page and History page while the Logout button will log the user out and navigate
them to the Login page.
20
CT100-3-3-AMCA Advanced Mobile Computing with Android
In the first Booking page, a list of sport facilities will be shown. User can filter the sport
facilities by clicking the search icon and input the type of sport or location of the sport facilities.
Then, user can click on the sport facility they wanted to book and they will be navigated to
second Booking page.
21
CT100-3-3-AMCA Advanced Mobile Computing with Android
In second Booking page, the information of selected sport facility from first Booking
page will be shown with the map. The map will be shown the location of the selected sport
facility, so user can have a better understanding on the exact location of the sport facility. User
can select the date they wanted to book for the sport facility and click Book button. The booking
will be made, and the user will be navigated to Home page.
22
CT100-3-3-AMCA Advanced Mobile Computing with Android
History Page
In History page, a list of booking made by user will be shown. User can have a look on
what they have booked previously, and they can choose to edit or delete the booking.
23
CT100-3-3-AMCA Advanced Mobile Computing with Android
Edit Booking
In History page, user can simply slide specific booking information to the right, then
the Edit button will be shown. User can click on the Edit button and a dialog will be shown to
user which the old booking will be deleted, and user will be navigated to first Booking page in
order to make a new booking.
24
CT100-3-3-AMCA Advanced Mobile Computing with Android
Delete Booking
In History page, user can simply slide specific booking information to the left, then the
Delete button will be shown. User can click on the Delete button and a dialog will be shown to
user for the delete confirmation and the list will be refreshed and the deleted booking
information will be gone.
25
CT100-3-3-AMCA Advanced Mobile Computing with Android
In the Login page, the admin will need to enter the username and password in order to
use the application for CRUDS operations.
Home Page
In the Home page, there will have two buttons at the menu bar and two buttons at the
middle of the web page. These buttons responsible to navigate the admin to the specific page.
26
CT100-3-3-AMCA Advanced Mobile Computing with Android
User Page
Once the User page loaded, a list of current users in the mobile application will be
shown. Admin can add new user to the Firestore by entering the details of the user then click
Add button. Admin can also search for user by name in the search text box. Admin can update
or delete the selected user from the list.
27
CT100-3-3-AMCA Advanced Mobile Computing with Android
Product Page
Similar to User page, a list of current sport facilities in the mobile application will be
shown once the Product page loaded. Admin can add new sport facility to the Firestore by
entering the details of the sport facility then click Add button. Admin can also search for sport
facility by name in the search text box. Admin can update or delete the selected sport facility
from the list.
28
CT100-3-3-AMCA Advanced Mobile Computing with Android
6.0 Conclusion
In conclusion, Book4Sport sport facility booking mobile application has been
developed in native Android environment. Android studio provides few useful libraries and
tools which helps in the application development process. The aim and objectives of the project
are met which all the important functions are implemented in the application and working
without errors. User can create, view, update and delete their booking without any issues. Other
than that, admin can use the web application to perform CRUDS operations on the user and
product information.
There are few limitations in the mobile application which can be further improved in
the future:
There are no notifications to notify the user when the booking date is close.
User can only book the sport facilities for the whole day, cannot book based on different
time slot.
User may not know which sport facilities provide the best condition since they are not
able to compare the sport facilities by rating and comments.
Messaging services are not provided in the application which the user have to call the
sport facility provider by themselves.
According to the limitations, there are some future enhancements that needed to be done in
order to provide the better user experience for the users:
29
CT100-3-3-AMCA Advanced Mobile Computing with Android
7.0 References
Android Developers, 2019. Meet Android Studio | Android Developers. [Online]
Available at: https://developer.android.com/studio/intro
[Accessed 25 May 2019].
Google Developers, 2019. Google APIs for Android | Map View. [Online]
Available at:
https://developers.google.com/android/reference/com/google/android/gms/maps/MapView
[Accessed 25 May 2019].
Javarevisited, 2019. 10 Reasons to Learn Java Programming Language and Why Java is Best. [Online]
Available at: https://javarevisited.blogspot.com/2018/07/10-reasons-to-learn-java-
programming.html
[Accessed 25 May 2019].
Lindsay Kolowich, 2018. Web Design 101: How HTML, CSS, and JavaScript Work. [Online]
Available at: https://blog.hubspot.com/marketing/web-design-html-css-javascript
[Accessed 25 May 2019].
30