mobile applications and cloud computingberaldi/macc_16/slides/01.pdf · amazon’s cognito •...

42
MOBILE APPLICATIONS AND CLOUD COMPUTING Roberto Beraldi

Upload: lykhue

Post on 11-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

MOBILE APPLICATIONS AND CLOUD COMPUTINGRoberto Beraldi

Page 2: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Course Outline• 6 CFUs• Topics:

• Mobile application programming (Android)• Cloud computing

• To pass the exam:• Individual working and documented application in android (possibly

using cloud services) • Answer to 3 of general questions

Page 3: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Key terms• Cloud computing �

• Delivery of remote virtual resources through internet (virtual machines, storage space, software functions (web api) , data – e.g. open data, etc..)

• Mobile Applications • app that runs on mobile devices � smartphone• App running on wearable devices, e.g., smartwatch

• Context-Awareness • sensors

• Where (lat,lon) the device running the application is located

• Other Sensors, e.g., acceleration, orientation, etc

• Connection and synergy between Cloud and Mobile devices/applications is possible

Page 4: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Cloud computing and mobile applications

• Cloud computing is an umbrella term to refer to a way to access functionalities remotely (e.g., via Internet)

• There are different ‘delivery models’ of cloud computing• Software as a Service (SaaS) or Web API• Platform as a Service (PaaS)• Infrastructure as a Service (Iaas) (virtualization)

• Cloud computing can be used ‘alone’, or… • Cloud computing, or more simply ‘cloud’, can be exploited

by mobile apps. This can be done in different ways• One simple possible way is to synchronize data views of different

devices (fixed or mobile)

Page 5: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

• Dropbox is a free (up to 2GB), web-based cloud storage mechanism• file backup service • data sharing• Data sync among different clients• Mobile applications

iPhone

iPad

Windows

Linux

MAC

.mp3

.avi.jpg

Freemium business model

REST / JSON calls

Dropbox

Security (SSL, AES-256 bit), scalabity (load balancer, server notification, data/metadata..)

Page 6: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Example: iCloud from Apple

-contacts-photo-messages.. Phone backup

-iCloud drive(store any kind of document)

cloud

Page 7: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Amazon’s Cognito

https://aws.amazon.com/it/cognito/

Page 8: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Amazon’s Cognito• Amazon Cognito gives you unique identifiers for your end

users and then lets you securely store and sync user app data in the AWS Cloud across multiple devices and OS platforms.

• You can do this with just a few lines of code, and your app can work the same, regardless of whether a user’s devices are online or offline.

• When new data is available in the sync store, a user’s devices can be alerted by a silent push notification so that your app can sync the new data automatically.

Page 9: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Characteristic of a cloud storage service

• Bundling• When a batch of files is transferred, files could be bundled, so that

transmission latency and control overhead are reduced.• For example, Dropbox use only few TCP connections to transfer

multiple files

• Chunking• Large files can be either monolithically transmitted to the cloud or

chunked into smaller pieces. Chunking is advantageous because it simplifies recovery in case of failures• Dropbox 4MB, Google Drive 8MB,…

• Compression• data compressed before a transfer. Compression could, in general,

reduce traffic and storage requirements at the expense of local processing time.

Page 10: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Characteristic of a cloud storage service

• Deduplication• Server data deduplication eliminates replicas on the storage server.• Client-side deduplication instead extends the benefits to clients and

the network: In case a file is already present on servers, replicas in the client can be identified to save upload capacity

• This can be accomplished by calculating a file digest using the file content, e.g., SHA256 is used by Dropbox

• The digest is sent to servers prior to submitting the complete file. • Servers then check whether the digest is already stored in the

system and skip the upload of repeated content.• Dropbox implements inter-user deduplication: this technique allows a

user to skip submitting files that are already stored by any other user.

Page 11: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Characteristic of a cloud storage service

• Delta encoding• Delta encoding calculates the difference among file revisions,

allowing the transmission of only the modified portions. • Indeed, delta encoding provides similar benefits as the combination

of chunking and deduplication, but with a finer granularity

• P2P synchronization• Devices hosting common files could be synchronized without

retrieving every content from the cloud, thus saving both network and server resources• Dropbox is known for implementing a LAN Sync Protocol that allows

devices, possibly from different users, to exchange content using P2P communication when clients are connected to the same LAN.

Page 12: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Comparison among personal cloud storage(*)

(*)E. Bocchi, I. Drago, M. Mellia, “Personal Cloud Storage Benchmarks and Comparison”, IEEE Transactions on Cloud Computing 2015

Page 13: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Other example: Microsoft’s IntuneMicrosoft Intune helps organizations provide their employees with access to corporate applications, data, and resources from virtually anywhere on almost any device, while helping to keep corporate information secure.

Intune can manage:Mobile devices (including phones and tablets running Android, iOS, Windows Phone and Windows RT operating systems).

Computers running a professional edition of Windows Vista, Windows 7, Windows 8 or Windows 8.1.

Page 14: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Cloud and mobile apps• Other ways to exploit cloud is by implementing a

notification service

Page 15: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Google Cloud Messaging (GCM)

push

GCM allows to attach up to 1,000 recipients to a single message

-Broadcastreceiver

connection server

app server

…..

Page 16: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Amazon’s Simple Notification Service (SNS)• It is a fast, flexible, fully managed push notification service

that lets you send individual messages or to fan-out messages to large numbers of recipients.

• Amazon SNS makes it simple and cost effective to send push notifications to mobile device users, email recipients or even send messages to other distributed services.

Page 17: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Amazon’s SNS (features)• Seamlessly scale from a handful of messages per day to

millions of messages or higher.

• With SNS you can publish a message once, and deliver it one or more times. So you can choose to direct unique messages to individual Apple, Google or Amazon devices, or broadcast deliveries to many mobile devices with a single publish request.

• SNS allows you to group multiple recipients using topics . • A topic is an “access point” for allowing recipients to

dynamically subscribe for identical copies of the same notification.

• When you publish once to a topic, SNS delivers appropriately formatted copies of your message to each subscriber.

Page 18: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Mobile apps and Software as a Service

Cloud

-Cloud can play the role of‘backend’-provide access to resourses:• Functionality (VM, storage)

using RPC-like calls)• Data (open data)

req

reply

Page 19: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Example

req

reply

Cloud

real time data on transportation available from ATAC via XML-RPC

http://www.agenziamobilita.roma.it/progetti/open-data/http://www.agenziamobilita.roma.it/it/progetti/open-data/api-real-time.html

Page 20: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Mobile apps and web API (aka SaaS)

WEB-API

INTERNET

Client Application

A Web API allows to design and develop an application that exploits software modules accessed via Internet via a simple wire protocol

Page 21: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Web API: example

Page 22: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Web API: programmatic point of view

Programmatic Service Access(many methods)

Web URL (standard HTTP methods)

web browerHTTP

Application

HTTP Rest,XML-RPC,etc

(Web API)

Page 23: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Mashup applications

Pro

vide

A

Pro

vide

rB …API WEB

CLIENT

s=A.methodName(par1)…z=B.methodName(s,par2)

Page 24: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Mashup applications (1/2)Client

Server

Web API…

Server

Web API…

JSON-RPC

Server

Web API

AJAXPython..

Page 25: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Mashup applications (2/2)

HTTP

-Server Web-”mashupper”(e.g.,dynamic pagesPhp)

WEB API

XML-RPC

SOAP

Page 26: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Web API and Interoperability

WEB-API

Client Application

(Technology A)

Client Application

(Technology B)

Client Application

(Technology C)

….

Page 27: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Example: Google apis

Page 28: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Example: Tic Tac Toe

• Monolithic application• All the logic is in a single program

• Client Server • The server dynamically generates the page to

be displayed with the response

• Web API (cloud computing style)• Provides primitive operations to an application

(that can run on a mobile device, for example) and let two players to play

Page 29: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

solution1: monolithic app• Monolithic

e.g., javaScript, or any language

Page 30: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Solution 2: client/server

http://game.org/ttt.php?move=7

• Client HTTP Server + php

HTML

Put an X at position 7

Page 31: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Possible technological mapping … (1/3)

Client Server

HTTP

HTML

User Agent

mod_php

TCP/IP connection3306,…

Page 32: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

…continued… (2/3)Client Server

HTTP

HTMLEmbedded

Objects

User Agent

mod_php

TCP/IP connection3306,…

Page 33: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

…continued(3/3)Client Server

HTTP

HTML+JS

User Agent

mod_php

TCP/IP connection3306,…

Page 34: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

3rd solution: Web Api and mobile app

Web API

(cloud)

init

• Send the current state

• Reply with the new state

Interface (remote functions)

backendfront end

move

Page 35: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

New trends: Mobile cloud computing

code/data offloading

result

• wi-fi direct (comm. feature)• reflection (language feature)

• security aspects• application partitioning • subtasks allocation• DTN and social behavior

• voice recognition• pattern recognition• augmented reality• games (e.g., chess)• …

computation

•Goal: To reduce the execution time

Page 36: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Mobile cloud computing*• Task offloading to other mobile device

(*) Mobile-to-Mobile Opportunistic Task Splitting andOffloading Beraldi et al., WiMob15

Page 37: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Mobile applications and QR code

QR-code

QR-reader

Internet

URI

Page 38: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Example

Page 39: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Another examples: media are changing

Same applies to books, newspapers, encyclopedia, etc.

Page 40: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Example: Augmented reality

Page 41: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Wearable devices

Page 42: MOBILE APPLICATIONS AND CLOUD COMPUTINGberaldi/MACC_16/slides/01.pdf · Amazon’s Cognito • Amazon Cognito gives you unique identifiers for your end users and then lets you securely

Summary• Cloud can be exploited in mobile apps in different ways

• Data synchronization among devices• Data storage system• Access functionalities provided via an interface (SaaS)• Mobile cloud computing

• … but, cloud computing in itself is a set of technologies that can be used alone (without connections to a mobile app)

• In addition, mobile apps can exploit new dimensions• Social (e.g, who is near me with the same interests)• Context-awareness (e.g., Google maps)• Sensors (NFC,GPS,…)• Augmented reality

• Moreover, mobile apps (as fixed apps) can exploit a lot of public available data (open data) for their purpose