mobile applications and cloud computingberaldi/macc/01_introduction_ok... · 2020. 10. 5. ·...

49
MOBILE APPLICATIONS AND CLOUD COMPUTING Roberto Beraldi

Upload: others

Post on 10-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

MOBILE APPLICATIONS AND CLOUD COMPUTINGRoberto Beraldi

Page 2: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Course Outline

Mobile Application Cloud Computing

Android

≈70 % ≈ 30 %

TOPIC

Exam

Written part

Course homepage: http://www.diag.uniroma1.it/~beraldi/MACC

Project(1-3 students)

0.3

0.7

Design Use

Weig

ht

Page 3: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Materials• There are not official books • All the materials are slides ans pointers to internet

recourses available on the web site of the course

Page 4: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Course outline• Applications for Mobile devices • The Android OS• Android SDK Framework• Activity,Fragment and Navigation• Sensors and orientation• 2D graphic• 3D graphic (introduction)• Storage• Services, Brodcast receivers• Cloud services

Page 5: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

More about your project

Cloud provider

Your cloud service

Multiuser

Responsive UI

Graphic

Concurrency

Sensors

Data consistency

Authentication

Web-api

CRUD interface

Security aspectsCharacteristics your applicationshould have

service your app should use

Your cloud part

Page 6: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Why/How mobile apps differ from desktop one?• Smaller Screen size• Organize the information accordingly, e.g., list

• Reacher Input/output system:• Input: sensors (GPS, orientation),..• output: vibration, ..

• Concern about energy consumption and efficiency• Apps have a lifecycle (can be suspended)• Memory management • Clock speed is tuned

Page 7: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

User behaviour • Very easy to install an application • Design UI is important• No Bugs (impossible) à TESTING • Crash (no second change)• Bad UX (User eXperience)• Slow

• Average number of installed applications ≅ 35 • Percentage of apps used per day ≅ 26 %

Page 8: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Functional decomposition of a generic app• User Interaction:• occurs mostly through GUI (gestures, …)• or other channels (vibration, notification)

UI

BUSINESSLOGIC • What the application ‘does’

DATA • How data are stored and managed

Tier

(or l

evel

)

Page 9: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Deploy architecture: how to map a three-tier architecture (tieràdevice)• Presentation tier à {M} M=Mobile, C=Cloud• Business logic à {M,C}• Data tier à {M,C}

PRESENTATION

BUSINESS

DATA

phon

e

[M,M,M]

PRESENTATION

BUSINESS

DATAclou

dph

one

[M,M,C]cl

oud

phon

e

PRESENTATION

BUSINESS

DATA

DATA

[M,M,M|C]

Page 10: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Deploy architecture: how to map a three-tier architecture (tieràdevice)

• Apps may strongly rely on a set of ‘services’ running remotely

PRESENTATION

BUSINESS

DATA

[M,C,C]

PRESENTATION

BUSINESS (C)

DATA

BUSINESS (S)

[M,M/C,C]

M=Mobile, C=Cloud

Page 11: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Mashup

G B1

SMARTPHONE

B3

B4

D

B2

DB2

D

Page 12: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

An example

-Wheatear Underground-Dropbox-Flicker

GUI

-Firebase-GAE …

-Google Maps

May

be

Stro

ngly

Inte

grat

ed in

IDE

Web

API

, WS

(may

pro

vide

s SD

K)

Backend

MB-

as-a

-Ser

vice

(pus

h no

tifac

tion,

mes

sage

s, e

tc

AuthenticationService-Facebook (e.g, Oauth)

Frontend

Page 13: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Another example

GUI

-Cloud9-Heroku..

PaaS

& S

aaS

(writ

e yo

ur O

wn

API)

Mashup App

Backend

Web

API

, RES

Tful

l WS

Storage

Frontend

Page 14: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Citizens of Internet

INTERNET

Things(Consumer IoT)

Page 15: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Example: enrolling a ‘smart object’

Connect to the object and configure

Object search for a wifi SSID

Page 16: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Example: enrolling a ‘smart object’

Logical communicationE.g. Send commands

Public internet

Page 17: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Fog Computing: moving services closer to data

100 ms

1 ms

Page 18: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

What is next?

100 ms

Bandwidth

Automated driving(<5ms)

Tactile Internet (>1Gbps,<1ms,99,999%)

10 Gbps

RTT

1 ms

ReliabilitySecurity

Mbps

Industry 4.0Mbps,<10ms,99,999%)

Content Delivery

Page 19: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Some popular technologies/tools

Frontend

Backend

Kotlin

titanium

Flutter

Page 20: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Example of an interface for a chess game

Web API

(cloud)

init

• Send the current state

• Reply with the new state

Interface (remote functions)

backendfront end

move

Presentation (View) +Controller

Business logic + data

Page 21: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

SW design patterns• The design and implementation of an application is

achieved following some design pattern

• The main goal of a pattern is to guide the software structure (architecture) in order to reach (among other goals) a high degree of flexibility (change or add functionality) and software testability (e.g. unit test)

• To this end, a patterns aims at organizing software in components that are loosely coupled (independent), so that the change in one component doesn’t affect other components

Page 22: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Model View Controller (MVC)Model View Controller

Presentation X

Business X X

Data X

• Business logic is not confined in one place

• Model and view are coupled

Page 23: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Patterns: MVC and MVP

MVP (Presenter): Model and View cannot communicateImproves testability and flexibility (change/add code)[MVC maybe fine for simple apps]

Model View Controller

Presentation X

Business X

Data X

Page 24: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

The role of framework

• A software ‘framework’ surronds the application software

APPLICATION (SW YOU WRITE)MVC MVP

Page 25: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

An example

Framework

SW components

UISW you write

loop

deliver

create

onCreate

Page 26: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Android framework

Page 27: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Mobile app classification• Web-site for mobile devices:

• deliver web content to mobile devices, using web site style navigation

• Mobile Web: • web application that mimics native apps look and feel as well as

navigation

• [Andorid|iOS] Native:• Applications installed on the devices, purched from app stores

• Hybrid:• Mix web and native applications

• Native:• C/C++

Page 28: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Why so many options, how to decide?• Complexity of the app• Productivity• Cross-platform • Quality of Experience• Testability • Performance • Accessible features

See: https://www.mrc-productivity.com/blog/2016/06/the-mobile-app-comparison-chart-hybrid-vs-native-vs-mobile-web/

Page 29: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

How to ‘create’ a mobile app?• To develop a mobile app, one can use methodologies from software

engineering• The ‘agile’ methodology is one possible well established method• Many agile frameworks exit, e.g., Scrum

• The entire framework is studied in SE

Page 30: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Behaviour Driven Design, aka BDD• A well established starting point is to define a storyboard

• This allows to elicit functional requirements (through user stories)

• Wireframe can be used

Page 31: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

User stories • User stories are a set of short descriptions about what the

a user can do with the application• An application is composed of many US

• A single user story is a narrative description of a single feature.

• As a user I want to login to the app so that I can use the full applications

Page 32: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

User stories and screen• A user story should be small enough to be represented in

a single screen

Page 33: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Storyboard à Navigation flow• Set of screens and their relationship

Screen 1

Touch a button

Screen 2

Page 34: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

A complete example• Goal of the application: share the parking place of a family

car, so that each user can know the position of the car

Page 35: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

User stories (example)• US1: I want to login in the app, so that only authorized users

can use the app

• US2: As an authenticated user, I want to store the position of the car on a map, so that another user can later locate the car on the map

• US3: As an authenticated user, I want to know the position of the current car, so that I can pick it

• US4: As an authenticated user, I want to set the state of the car as busy or available, so that other users can know its current state

Page 36: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Mapping US1

Login

• US1: I want to login in the app, so that only authorized users can use the app

Page 37: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Mapping US2

Park here

• US2: As an authenticated user, I want to store the position of the car on a map, so that another user can later locate the car on the map

Page 38: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Mapping US3

• US3: As an authenticated user, I want to know the position of the current car, so that I can pick it

Page 39: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Mapping US4

• US4: As an authenticated user, I want to set the state of the car as busy or available, so that other users can know its current state

BUSY

Page 40: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Login

Storyboard

park

busy

Park here

Select a function

ERROR

Select

Status

Set status

Page 41: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Storyboard

Page 42: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Storyboard

LOGIN ERROR!

Page 43: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Storyboard

Select

Status

Park here

Page 44: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Storyboard

Page 45: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Storyboard

busy

Page 46: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

User navigation flow

Splashscreen

MainScreen Screen1

Screen2

…..

Page 47: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Example of storyboard for iOS

Page 48: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

Example of storyboard in Android

The storyboard facility was recently added to Android Studio and it is part of the Jetpack library

1 destination2 action

Page 49: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC/01_Introduction_OK... · 2020. 10. 5. · Course outline •Applications for Mobile devices •The Android OS •Android SDK Framework

QUESTIONS?