Professional Documents
Culture Documents
4.1 Introduction
This chapter shows the process of building the application, views in detail the
process of building a mobile app and dealing with the programming environment, as
well as engaging with other tools that help facilitate the process and working from
different devices simultaneously.
33
CHAPTER 4 PROJECT IMPLEMETATION
A demo flutter application code will be placed in the new project figure (4.2), the
unnecessary code can deleted.
Now, it is time to take two steps:
1. Start creating project files according to the design patterned (file architecture)
that was chosen.
2. Initiate a Git Repository in the project and associate it to a Gitlab project so it
can be managed remotely by multiple users.
35
CHAPTER 4 PROJECT IMPLEMETATION
Note that all project files written in Dart language will be under the lib folder under
one of these three folders.
Figure (4.5) shows the initial files in each of the three folders:
1. The device info controller file holds the methods that will fetch KPI and store
them in the database.
2. The KPIs model represents fetched data.
3. The about, home, and network info screens represent the main screens.
4. The widgets folder contains any extracted code so that everything stays
organized.
Before moving forward in writing the code, it is time to initiate a Git repository in
the project.
36
CHAPTER 4 PROJECT IMPLEMETATION
Then Gitlab gives an option of adding other participants in the project, by inviting
them via email address figure (4.7):
37
CHAPTER 4 PROJECT IMPLEMETATION
Under the project directory in the command line interface, the following commands
are issued figure (4.8):
After issuing the previous commands, all team members can work on the project
simultaneously, and push changes whenever needed, so everyone stays updated.
4.3 Git flow:
Before starting to write the code, it is important to show the power of Git and Git
flow. GitFlow refers to the flow of the project development, figure (4.8) shows the
GitFlow chart
Figure (4.9): Git commands for pushing a folder into Git repository
38
CHAPTER 4 PROJECT IMPLEMETATION
Every Git project is divided into branches, and each branch indicates a phase or a
section in the project:
39
CHAPTER 4 PROJECT IMPLEMETATION
40
CHAPTER 4 PROJECT IMPLEMETATION
Notice in figure (4.10) the selected KPIs, in addition to two important fields:
phoneNumer and location and the reason that they’re both are annotated by the
keyword @required is because of their importance when fetching the data from the
user, any data will be clueless if it was missing one of these elements, so this prevents
the creation of an instance of the class KPIs for a user without fetching these two
parameters, whereas other fields can be empty.
The next table shows the chosen fetched KPIs, and their applicability in
each mobile generation.
41
CHAPTER 4 PROJECT IMPLEMETATION
Table (4.1): shows the chosen fetched KPIs, and their applicability in each mobile generation
4G 3G 2G
KPIs
Service & Service & Service &
Neighbor cells Neighbor cells Neighbor cells
Cell Identify Code Cid
Yes Yes Yes
Complaint
Yes Yes Yes
operator
Yes Yes Yes
Luckily flutter allows us to write native code inside the project and then invoke it
back inside the project, this method is called: Flutter platform channel.
42
CHAPTER 4 PROJECT IMPLEMETATION
Since the project is only working on android, platform specific codes is only written
on the android folders as follows:
1. In the mainactivity file inside the android folder, the following code is placed
inside the mainActivity class:
The code snippet in figure (4.11) shows the typical way of creating a platform
channel from the android side, notice some additional lines of code to assure that
the permissions are granted to read the desired data from the phone.
In (figure 4.12) the method getData() returns a string that holds allCellInfo, which
means all needed KPIs, and the advantage here is that no need to change the code
according to the mobile generation.
3. Before going back to flutter and invoking the method, the following lines of code
should go inside the AndroidManifest file, in order to grant permission to the
application (figure 4.13).
4. Now that everything is set, it is time to work in flutter and write the lines of
code as shown in figure (4.14).
44
CHAPTER 4 PROJECT IMPLEMETATION
5. The method getKeyValuePair in figure (4.14) searches for the desired KPIs in
the string response from the android side to a list of entries, whereas the other
method getDeviceInfo puts them in a list so that they can displayed in the UI
and/or sent to the database to store.
45
CHAPTER 4 PROJECT IMPLEMETATION
2. Set the database to accept data as modeled in the KPIs model class, by going
to cloud store and create the following collection as shown in figure (4.15):
3. Get back to the project and add firebase in it, again by following the
documents in step 1.
4. Inside the device info controller, define a function that to store data on the
hbv
database.
5. This function will be called whenever the user will send a report to the
company using the app.
Now that everything is in place, it is time to design the UI for the screens.
46
CHAPTER 4 PROJECT IMPLEMETATION
Home screen:
This is the default screen where the user can test current network performance,
and send a report to the company in case there are any issues (figure 4.16).
Figure (4.17): The Reporting window Figure (4.16): The Home screen
If the user presses Test, the indicator (needle) will point out to the signal quality
according to the signal strength.
47
CHAPTER 4 PROJECT IMPLEMETATION
And if the user presses report the following pop-up window will appear as shown in
figure (4.17).
The user now can simply enter his phone number, and address his problem, and when
presses send report the KPI measurements will be sent as well to the database, this
process happens behind the scene, to reduce complexity for the users.
Network info screen:
This screen is responsible for viewing the KPIs on it, in case the user was
curious to read the measurements and see the cellular network quality on his own,
the KPIs will appear to him as he presses “Test network” figure (4.18)
About screen:
This screen is designed for users to view information about the app, namely
the app version, copyrights if exist, and means to contact the developers in case
they need any extra information as shown in figure (4.19)
Figure (4.19): The About screen Figure (4.18): The About screen
48