Professional Documents
Culture Documents
will be allocated at the mobile graphic mobile application. This is done prices for a gas stations.
interface. Finally, it will consider how by establishing a list of use cases •Third Party Services Use -
the technology developed here can be and desired features. Google Map integration for GPS,
expanded into other areas/solutions. Is expected for that application to: User identification.
B- POLITECHNE
With this exercise, the basic model munication. Nowadays there are phone manufacture of his choice.
of a mobile infrastructure starts to a lots of options as Web Stack, but The manufacture will provide
take shape. for this project a Linux-Apache its Linux Kernel which is from
MySQL-FHP (LAMP) Web Stack where the Android framework
DESIGN wifi be implemented as it covers operates from and the commu
Translating desired/needed fea all the necessities of the mobile ar nication between their hardware
hires to system components cre chitecture in a relative simple way and the Android OS called Hard
ates a starting point for 11w de 8] [9] The AWS EC2 instance ware Abstraction Layer (HAL).
sign. The design is developed by wifi provide the cloud/web com The OS wifi provide a complete
expanding and completing the puter to host a Linux OS. Linux environment from where to run
existing identified components by wifi be hosting the server Apache an Android application [13] This
.
taking into consideration all tech to receive the HTIEP requests to means that the implementation of
nical aspects that are required to the server [10] Other two compo
. the mobile client will only need to
build the mobile architecture. nents that the OS will be hosting focus on the Android mobile ap
There are three more functional are the database system MySQL plication.
ities that from a technical aspect and the scripting language pre Finally, the inter component
are required to complete the mo processor PT-IF MySQL wifi con communication wifi be imple
bile infrastructure, and those are: tain the mechanism to storage mented using a RESTful API.
•htter Component Conunu data in the OS file system and the The RESTful API make use of
nication individual components
- language to request and submit the HTIP technology to establish
needs to have a common way to data on it [11] P1W is a hypertext
. communication between web and
communicate with each other. processor that allows us to define mobile components [14].
•Data Storage —need to store all and handle the server request/re
prices submitted by the users and sponse and the local interactions IMPLEMENTATION-WEB
provide them back to the users. with the database [12] See below . SERVER
• Security the infrastructure
— illustration for an overall setup for The web sewer is divided and
needs to provide the basic prin the web server configuration. implemented into the following
ciple of security: confidentially, in groups:
tegrity and availability (CIA) [3]. • database management
Internet
•security and access
From now on all the components
are identified from the ground up ,j—~-- - - - —.F~ EC2 Linux Wi
•third party services
•suppoi-t
starting from what will host each
component of the mobile infra ~ t e MYSQL The database manage
Apache ~ PF4P
structure, up to which technolo ment control the access to
gies are used to implement them. the database management
To run a web sewer, we need Server!
Inter Component Comm ~ Data Storage system and the stored data
to select an Infrastructure-as-a- for internal (mobile app au
Service (laaS) provider [4] [5] Figure 1: Web Server thentication) and external
The IaaS provides the computing (app data) requests. It is executed
and cloud resources to host the The remainder of the respon by three PHI’ classes which are:
mobile infrastructure server side. sibility for a mobile architecture • db_config.php
This project will be build using fails under the Mobile Client. • db_class.php
the Amazon Web Services (AWS) The Mobile Client will provide • db_manage.php
Free Tier in particular the Ama the users the mobifity meaning
zon Elastic Compute Cloud (EC2) that the service available from The db_config holds the infor
and the Elastic Load Balancer ser anywhere where there is a mo mation needed to connect to the
vices [6] [7] Over this IaaS a Web
. bile carrier data signal. For this database management system.
Stack can be installed to support project it will be used the well- The db_class defines the object
all the Web Sewer functionalities, established Android Operative with which the web server con
Data Storage, Security and part System (OS) en~ironment. The nects to the database system in
of the Inter Component Com user wifi be able to choose a cell order to provide and request
POLITECHNE -7
information to the database in called Places API. To manage the plication to ask the server to re
a generic aspect. These two file Places API endpoints and creden quest all near gas stations from
codes contribute into creating the tials the following code file was the Google services Places API.
technology for the mobile archi created: The set_gas_prices allows the
tecture. Last db_manage is the ap =google_api_config mobile application to ask the web
plication specific implementation server to store gas prices for a gas
for the database which defines the Another third party service station near the user that was pre
queries that wifi be performed by needed for the system is the defi sented as a part of gas station list.
both the web server and the mo nition of valid gas prices. This is To support the ability to provide
bile client application. taken for the local Puerto Rico gas prices by users, the mobile
Creating a service that is acces consumer department DACO application can get a valid range
sible through the internet brings [2] The following code file man
. for gas prices from the web server
the challenge of how access to age to grab the price ranges from by using the endpoint get_price_
that service wifi be managed. The DACO: ranges with which the application
security and access from the web =Get_daco_gas_price_rang can determine if the prices pro
server point of view are related to es.php vided by a user are valid or not.
geffing access to the web server To support the business models of
services, and which http protocols Finally, there is a support func providing ads the REST API have
are used to communicate securely lion to calculate distance between the endpoint get_ads which re
to the server. The following code the coordinates of the user loca turn all the ads entered by the da
ifies manage these aspects: tion and the gas stations near him. tabase administrator in the data
• fliletealo_api_authorizer.php base. This endpoint also provides
•http_post_only.php IMPLEMENTATION RESTAPI- a possible component for future
The REST API is used in other different mobile architecture.
The fuletealo_api_authorizer to enable a standardize way from To complete the RESTAPI all
will ensure that the mobile appli which two different components the http calls were defined within
cation developed for this mobile can communicate with each other. and Android library [16] Within
.
architecture is the only with ac This communication is done with this library various java classes
cess to the web server services. It the use of the http verb POST. The where defined to enable commu
does that be validating a unique two components that wifi make nication through the RESTAPI.
information provided by the mo used of it in the mobile architec The classes can be group under
bile application against what is ture are the Wed Server and the the following categories:
store on the database for the same Mobile Application. The mobile •HflP Connector: REST(Jtil.
mobile application. application will always be the re java
Of all the http methods avail quester and the web server will be •RESTAPI client: Server.java
able the http POST is the only the responder. •Data modeling: UserData.
that don’t expose the user / client At the web server side, the RE java, GasPrices.java
submitted data on the request STAPI make available the follow • Support: AppFingerprint.
url. Therefore, the http_post_only ing endpoints (urls): java, Hash.java
code file will ensure that all re • (domain)! get_gas_stations.
quests made to the web server php The RESTUti1 class provides
are POST methods or they will be • (domain)! set_gas_prices. the bare bone of the htttp protocol
rejected. These two code files wifi php for the mobile application which
also provide towards creating the • (domain) I get_price_ranges. is used by the server class to con
mobile architecture technology. php nect!use the endpoints provided
Between the application spe • (domain)! get_ads.php by the web server. The server
cific functionalities there is the class also make use of the Ap
capabifity gas stations near to the The main two functionalities of pFingerprint and Hash classes to
user. To accomplish this, the sys the mobile application are getting provide the web sewer a unique
tem make use of a third party ser near gas stations and providing irtfomwtion with which the serv
vice from Google that enables this prices for them. The get_gas_sta er can uniquely identify the mo
functionality at a sewer level [15] tions.php allows the mobile ap bile application. Finally, the data
8-POLITECHNE
modeling classes UserData and [17] The data modeling classes
. U
GasPrices are used for easiness to put together all data infomtation
data allocation and transmission. into an object for easiness of use P~mi. Ri~d) P1566)
This Android library represent a and manage. To control the com 1.2km D;(.d6) ‘lies
building block for fixture mobile ponents of the list view fo’r the d loom W(.66)
0:(.ddl P(id6)
Jon
0
architecture as well. gas stations the ListAdapter was
created. The list can sort the gas
e Pin.
32ki11 51.46)
01564) lOSS
P1*44)
0
IMPLEMENTATION MOBILE - station list by using the class My- ‘•
PinS
3.2km
ft (odd)
i:(Sd6)
P1.4*
Joe.
0
APPLICATION Comparator which allows the list
The mobile application can be to be sorted by gas station brand,
P....
130*i
t(d4)
01.dd)
~1s4*
Ills,
0
divided into two major areas: its distance and prices. To obtain the O 3.6km ~. i:(.d6)
5(564) P1Airs
other in a timed cycle. This class ging the gas station list down, the
can be used as well as a mobile application request again the list
architecture building block where FMPIII> i~. IP~kIl.l_ 1.11 of gas station neat and them up
and ads system is in place. Since dates the list accordingly.
the mobile application is devel 5. Three Vertical Dots Icon -
Figure 2. Initial Splash View
opec! for a local (Puerto Rico) au when selected it present the user
dience, the class Region Validator an option to logging (identi~’)
evaluates the current user coor After the user passes the loca itseJf into the application. This is
dinates to enable the application, tion validation where his current required to submit gas prices.
if the user is outside an autho location is evaluated against an 6. Sort Icon when selected it
—
rized region, the class make the authorized region, the user is tak presents a popup window to se
application close right away. The en to the user principal view the led a criterion for sorting the pre
GoogleSigninManager wrap the main activity. sented list.
configuration for using a sign in The main activity offers the fol
system with the Android account lowing GUI interactions: To be able to submit gas prices
used for the Play Store application 1. Ads when this area is se the user needs to login using its
POLITECHNE -9
Google account. Once logged in, it tioned here because of the AWS
can perform a long click over the sign certificate feature. This will
gas station row for which it wants create an https communication
to provide/update gas prices. On protocol which is encrypted be
the text input fields, the DACO’s tween the server and the mobile
defined prices ranges are shown. application [211.
Distance
SISIIOII Name
FUTURE WORK
Gas Prlce/ie~uiar
A very important aspect of a
mobile architecture that use da
Gas Prlce/Pi*rnium
tabases is the maintenance of it
Gas prIce/Diesel
which includes period backups so
Gasolinam a,eo Means”
that the system data source can be
21-23 PueeloRIcoO5l, 71511110 Alto
restore completely if necessary.
Another important aspect is
Urdate Gas PsCfl
References
[1] Empresas O’Neill. (2018, October 17). Enzpirsas O’Neill, LLC [Online]. Available: https:/ /www.empresasoneiilcom.
[2] Departan-iento deAsuntos del Consumidor (DACO). (2018, October 17). Precios de Gasolina [Online].
Available: http: / I daco.pr.gov/servicios/precios_combusti bles/preciotgasolina IPages/default.aspx.
[3] C. P. Pfleeger & S. L. Pfleeger, Analyzing Computer Security, Prentice Hall, 2012, ch. 1.
[4] ProlitBricks. (2018, October17). What is Infrastructure as a Service (IaaS)? [Online].
Available: https: / Iwww.profit bricks.com/en’us/cloud-lexicon/iaas/.
[5] Stackyfy. (2017, October 7). Top IaaS Providers: 42 Leading IaaS Providers to Streandine Your Operations [Online].
Available: https:I Istackifycoml top-iaas-provi ders?.
[6] AWS. (2018, October 17). AWS Free Tier [Online].
Available: https:/ Iaws.amazon.com/free/?awsf.Free%20 Tier%2OTypes=categories%23l2monthsfree.
[7] AWS. (2018, October17). Amazon EC2 [Online]. Available: https:/ Iaws.amazon.corn/ec2/.
[8] StackShare io. (2018, October17). Tech Stacks [Online]. Available: https:/ /stackshare.io/stacks.
[9] M. Korsak. (2016, May 31). What is a LAMP Stack? [Online].
Available: https: I /medium.comllinode-cubelwhat -is-a-lainp-stack-4c36da4d2aa8.
[10] Mozilla. (2018, October 17). An overview ofI-ITTP [Online].
Available: https: / Idevelopetmozilla.orglen-USI docs/Web/HTFP/ Overview.
[11] MySQL. (2018, October17). What is MySQL? [Online].
Available: https: / Idev.mysqLcom/doc/refman/5.7/en/wl-iat-is-mysql.html.
[12] PHP. (2018, October17). What is PHI’? [Online]. Available: http:/ /php.net/manual/en/intro-whatis.php.
[13] Android, Developers. (2018, October 17). Platform Architecture [Online].
Available: http://php.net/manual/en /intro-whatis.php.
[14] REST API Tutorial. (2018, October 17). Learn REST: A RESTJId Tutorial [Online].
Available: https:/ /www.restapi tutorial.com/.
[15] Coogle. (2018, October17). Places API [Online]. Available: https: / /developers.google.com/places/web-servi ce/intro.
[16] Android. (2018, October17). create an Android libranj [Online].
Available: https: / /developer.android.com/studio/ projec~/android-library.
[17] Android. (2018, October 17). Coogle Sign-In for Android [Online].
Available: htips:/ /developers.google.com/identi ty/sign-in/android/s tart-integrating.
[18] Android. (2018, October 17). Location Strategies [Online].
Available: https: / /developer.android.comlguide/topics/loca don/strategies.
[19] Android. (2018, October 17). Google Maps Intents for Android [Online].
Available: https: / /developers.google. corn/maps/documentation/urIs/android-intents.
[20] w. Stalling, Ct yptography and Network Security, Pearson, 2012, ch. 9.
[21] AWS. (2018, October 17). Elastic Load Balancing SSL/ITS cerflficates for classic Load Balancers [Online].
Available: https: / / docs.aws.amazon.corn/elasticloadbalan dng/latest/classic/ssl-server-cert.hhnl.
[22] AWS. (2018, October 17). AWS Elastic Beanstalk [Online]. Available: https:/ /aws.arnazon.com/elasticbeanstalk/?ncl=h_ls.
POLITECHNE .11