architectural styles for the development of wot...
TRANSCRIPT
![Page 1: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/1.jpg)
ICWE’19 FEDERUna manera de hacer Europa.
Architectural Styles for the Development of
WoT Applications
Jose Garcia-Alonso@jmgaralo
Javier Berrocal@jberolm
![Page 3: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/3.jpg)
ICWE’19
Context• Mobile apps
![Page 4: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/4.jpg)
ICWE’19
Index
• Server-Centric vs Mobile-Centric
• Consumption estimations
• Generating Mobile-Centric APPs
![Page 5: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/5.jpg)
ICWE’19
SC vs MC• Server-Centric
![Page 6: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/6.jpg)
ICWE’19
SC vs MC• Mobile-Centric
![Page 7: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/7.jpg)
ICWE’19
SC vs MC• Mobile-Centric
![Page 8: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/8.jpg)
ICWE’19
SC vs MC
![Page 9: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/9.jpg)
ICWE’19
SC vs MC
Javier Berrocal, José García-Alonso, Cristina Vicente-Chicote, Juan Hernández Núñez, Tommi Mikkonen, Carlos Canal, Juan Manuel Murillo:Early analysis of resource consumption patterns in mobile applications. Pervasive and Mobile Computing 35: 32-50 (2017)
![Page 10: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/10.jpg)
ICWE’19
HeatMap
![Page 11: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/11.jpg)
ICWE’19
HeatMap- Funcionality
• Two main funcionalities
– Gather users’ positioning
– Generate heatmap
![Page 12: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/12.jpg)
ICWE’19
HeatMap- Implementation
• Three architectures
– Server-Centric
– Mobile-Centric
– Hybrid
![Page 13: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/13.jpg)
ICWE’19
HeatMap- SC
![Page 14: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/14.jpg)
ICWE’19
HeatMap- MC
![Page 15: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/15.jpg)
ICWE’19
HeatMap- Hybrid
![Page 17: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/17.jpg)
ICWE’19 FEDERUna manera de hacer Europa.
Consumption estimations
![Page 18: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/18.jpg)
ICWE’19
Consumption estimation• If we analyze mobile apps, we find lots of
funcionalities created by composing the sameprimitive operations
![Page 19: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/19.jpg)
ICWE’19
Consumption estimation• If we analyze mobile apps, we find lots of
funcionalities created by composing the sameprimitive operations
Primitive
store(content_size)
post(content_size)
get(content_size)
receivePush()
getGPS()
![Page 20: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/20.jpg)
ICWE’19
Consumption estimation• If we analyze mobile apps, we find lots of
funcionalities created by composing the sameprimitive operations
• The used operations and its order depend on thespecific funcionality and the architecture
Primitive
store(content_size)
post(content_size)
get(content_size)
receivePush()
getGPS()
![Page 21: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/21.jpg)
ICWE’19
Consumption estimation• Conceptual Framework
– Primitive operations
– Different architectures
– Several use cases
– Use cases are composed by primitive operations
– Architectures are composed of use cases
21
![Page 22: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/22.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
22
![Page 23: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/23.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
23
UC – 1 Send GPS positionUC – 2 Receive alert message
![Page 24: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/24.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
24
UC1 UC1
UC2 UC2
UC2 UC2 UC2 UC2
UC – 1 Send GPS positionUC – 2 Receive alert message
Server-Centric Mobile-Centric
![Page 25: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/25.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
25
getGPS getGPS getGPS getGPS
Server-Centric Mobile-Centric
![Page 26: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/26.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
26
Server-Centric Mobile-Centric
![Page 27: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/27.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
27
push push
Server-Centric Mobile-Centric
![Page 28: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/28.jpg)
ICWE’19
Estimación Consumo• Emergency Alerts
28
CU1 CU1
CU2 CU2
Server-Centric
UC1 = ( getGPS() + post (16b) ) x GPSFreq
UC2 = receivePush() x PUSHFreq
SC = UC1 +UC2
![Page 29: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/29.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
29
Server-Centric Mobile-Centric
push push
![Page 30: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/30.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
30
push push
Server-Centric Mobile-Centric
push push pushpush
getG
PS
getG
PS
getG
PS
getG
PS
![Page 31: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/31.jpg)
ICWE’19
Consumption estimation• Emergency Alerts
31
UC2 UC2 UC2 UC2
Mobile-Centric
UC1 = ∅
UC2 = ( receivePush() + getGPS()+post (16b) ) x PUSHFreq
MC = UC1 + UC2
![Page 32: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/32.jpg)
ICWE’19
Consumption estimation• Knowing the consumption of each primitive, we
could estimate the consumption of mobileapplications. Even for different architectures
32
![Page 33: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/33.jpg)
ICWE’19
Consumption estimation• Knowing the consumption of each primitive, we
could estimate the consumption of mobileapplications. Even for different architectures
33
On early stages and without implementing the apps
![Page 34: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/34.jpg)
ICWE’19
Consumption estimation• Knowing the consumption of each primitive, we
could estimate the consumption of mobileapplications. Even for different architectures
34
Primitive Size (Bytes) Battery (μAh) Data (Bytes)
store 16 0,44 0
post 16 16,83 1067
get 16 16,29 657
receivePush 140 18,36 407
getGPS n/a 7,20 0
On early stages and without implementing the apps
![Page 35: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/35.jpg)
ICWE’19
Consumption estimation• Simple apps simple estimation
• Complex apps not so direct estimation
• If we want to follow the app evolution underdifferent circumstances, estimation gets even more complex
35
https://api-consumptions.herokuapp.com/
![Page 36: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/36.jpg)
ICWE’19
Consumption estimation• The API takes a JSON describing the app and
calculate its consumption
36
![Page 37: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/37.jpg)
ICWE’19
Consumption estimation• We can see an example
Repository:
API:
37
https://api-consumptions.herokuapp.com/
https://github.com/jberolm/ICWE19
![Page 38: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/38.jpg)
ICWE’19
Consumption estimation• The API generates a CSV result following this
format:
38
Architecture_“arName1”_Battery(μAh)
Var1 Var2 … VarN Result
-- -- -- -- --
-- -- -- -- --
Architecture_“arName1”_Data(Byte)
Var1 Var2 … VarN Result
-- -- -- -- --
-- -- -- -- --
CU_“cuName”_Battery(μAh)
Var1 Var2 … VarN Result
-- -- -- -- --
-- -- -- -- --
![Page 39: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/39.jpg)
ICWE’19
Coffee Break!
![Page 40: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/40.jpg)
ICWE’19 FEDERUna manera de hacer Europa.
Generating Mobile-Centric APPs
Javier Berrocal@jberolm
![Page 41: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/41.jpg)
ICWE’19
OpenAPI• Almost any application make use of APIs to connect
with other applications or with other parts of that application.
![Page 42: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/42.jpg)
ICWE’19
OpenAPI
Server-Centric APPs
![Page 43: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/43.jpg)
ICWE’19
OpenAPI
Server-Centric APPs
![Page 44: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/44.jpg)
ICWE’19
OpenAPI
Server-Centric APPs
![Page 45: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/45.jpg)
ICWE’19
Generating MC APPs
6
Mobile-Centric APPs
![Page 46: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/46.jpg)
ICWE’19
Generating MC APPs
7
Mobile-Centric APPs
![Page 47: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/47.jpg)
ICWE’19
Generating MC APPs• Steps:
– Create the APP’s specification with OpenAPI.• An example can be seen in the following URL
https://github.com/jberolm/ICWE19
![Page 48: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/48.jpg)
ICWE’19
Generating MC APPs• Steps:
– Generate the mobile-centric app following the spec.
https://openapi-generator-spilab.herokuapp.com/
![Page 49: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/49.jpg)
ICWE’19
Generating MC APPs• Steps:
– Download the generated APP.
![Page 50: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/50.jpg)
ICWE’19
Generating MC APPs• Steps:
– Create a Firebase project
https://console.firebase.google.com
1 2
![Page 51: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/51.jpg)
ICWE’19
Generating MC APPs• Steps:
– Register app and download the file google-services.json
Package name Thisinfo is in the file build.gradle of the downloaded app. Label applicationId
1 2
Google-services.json shouldbe stored in the rootdirectory
![Page 52: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/52.jpg)
ICWE’19
Generating MC APPs• Steps:
– The file local.properties should be created in the APP’s root directory
– This file should include information about the directory of the Android SDK
![Page 53: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/53.jpg)
ICWE’19
Generating MC APPs• Steps:
– Build and generate the APK.
• The APK should be located in the filder “build\outputs\apk\debug\”
.\gradlew assembleDebug
![Page 55: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/55.jpg)
ICWE’19
Calling a MC endpoint
16
![Page 56: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/56.jpg)
ICWE’19
Calling a MC endpoint• Steps:
– Before calling the endpoint, we need two important data.• Token: provided by the installed app• Authorization: obtained from the Firebase Console
![Page 57: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/57.jpg)
ICWE’19
Calling a MC endpoint• Steps:
– (Option 1) using Postman:• Url: https://fcm.googleapis.com/fcm/send• Headers:
– Content-Type: application/json– Authorization: key=<obtained in the previous slide>
• Body:
![Page 58: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/58.jpg)
ICWE’19
Calling a MC endpoint• Steps:
– (Option 2) Generate a HTML client to call the MC API’sendpoints:https://openapi-generator-spilab.herokuapp.com/swagger-ui.html
![Page 59: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/59.jpg)
ICWE’19
Calling a MC endpoint• Steps:
– (Option 2) Use the generated client :• Provide the toke, Authorization key and the endpoint parameteres.
![Page 61: Architectural Styles for the Development of WoT Applicationsweb.geni-pco.com/icwe2019/tutorial4.pdf · 2019. 6. 12. · Javier Berrocal, José García-Alonso, Cristina Vicente - Chicote,](https://reader035.vdocuments.mx/reader035/viewer/2022071112/5fe7da55d5cd1376101c2961/html5/thumbnails/61.jpg)
ICWE’19 22
¡Muchas gracias a todos!
THANK YOU!