applications mobiles

116
Pulling ITSM together Cedric Gatay - [email protected] Applications mobiles One code to rule them all ! 1

Upload: cedric-gatay

Post on 06-Jul-2015

609 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Applications mobilesOne code to rule them all !

1

Page 2: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Cedric GataySRMvision - Tech LeadAndroid Developer

@Cedric_Gatay

2

Page 3: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Interfaces utilisateur3

Page 4: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Éléments de navigation

4

• Interactions utilisateurs

• Grille

• Liste

• Onglets

• Skeumorphisme

• Carrousel

• Zone infinie

Page 5: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Grille

• Balance l’importance des éléments

5

Page 6: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Liste

• Efficace pour beaucoup d’éléments

6

Page 7: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Onglets

• Attention à marquer la différence visuelle

7

Page 8: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Skeumorphisme

• Réplique l’apparence d’un objet réel

8

Page 9: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Carrousel

• Navigation dans peu d’éléments

9

Page 10: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Zone infinie

• N’affiche qu’une partie de l’élément

10

Page 11: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Éléments d’interface

• Inscription / Connexion

• Recherche

• Action

• Confirmation / Notification

• Premier lancement

11

Page 12: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Inscription / Connexion

• Rendre facile l’inscription

12

Page 13: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Recherche

• Enrichir les résultats au fil de l’eau

13

Page 14: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Action

• Ne pas hésiter à utiliser du texte

14

Page 15: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Notifications

• Intrusif donc à utiliser avec précaution

15

Page 16: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Premier lancement

• Apprendre l’utilisation à ses utilisateurs

16

Page 17: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Points de vigilance

• Skeumorphisme mal choisi

• Boites de dialogue inutiles

• Non conforme aux recommendations

• Interface surchargée

17

Page 18: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Mobiles18

Page 19: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Points communs

19

• Capteurs

• Résolution limitée

• Connectivité limitée

• Puissance limitée

Page 20: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Différences

20

• OS différents

• Environnement de développement

Page 21: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Cible d’une application

• grand nombre d’utilisateurs

• grand nombre de devices

Attention au coût de développement

21

Page 22: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Problématiques

• Beaucoup (trop ?) de plateformes

• Marché verrouillé

• Les utilisateurs veulent votre application peu importe leur device

22

Page 23: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Problématiques

• Nécessité de développer pour chaque device

• Coûteux

• Difficile

23

Page 24: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Une solution

• Technologies Web

• ancien ( > 15 ans)

• cible principale des mobiles

24

Page 25: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Technologies Web

• standardisé

• peu coûteux

• facile à comprendre

25

Page 26: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Write Once Run Anywhere26

Page 27: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Tour d’horizon27

Page 28: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5

28

• Certainement la seule technologie cross-platform

• simple et universel

Page 29: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5

• nouveau standard du HTML

• supporté par une majorité de browsers

• http://caniuse.com

29

Page 30: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Pourquoi HTML 5

Extension d’HTML 4

• nouvelles balises

• nouveaux attributs

• nouvelles API

30

Page 31: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

A quoi ça ressemble<!DOCTYPE html><html> <head> <title>Title</title> </head> <body> <p>Content</p> </body></html>

31

Page 32: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML Doctype

• Indispensable

• Dicte au browser le mode de parsing

32

Page 33: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5

• Nouvelles balises

• séparation contenu / présentation

33

Page 34: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Nouvelles balises

<section> zone de la page

<header> en-tête de section

<footer> pied de page de section

<nav> zone de navigation

34

Page 35: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5 Metadata

• attribut data-* des balises

• récupérable en JavaScript

35

Page 36: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5 validation

• indication du type de données

• évite la validation JavaScript

36

Page 37: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5 validation

<input type="date">

<input type="email">

<input type="number">

37

Page 38: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5 Forms

• autofocus

• positionne le focus sur l’élément

• placeholder

• indique le contenu attendu

38

Page 39: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML 5 Forms

• required

• indique que le champ doit être rempli

• pattern

• permet de spécifier le contenu attendu

39

Page 40: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 Multimedia

• <audio|video>

• inclusion de fichier son / video

• contrôlable en JavaScript

40

Page 41: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 : stockage

• localStorage

• stockage clef / valeur

• associé au site

• persistant

41

Page 42: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 : stockage

• sessionStorage

• perdu à la fermeture du browser

42

Page 43: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 : stockage

• WebSQL

• implémentation SQL

• persistant

43

Page 44: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 : stockage

• IndexedDB

• évolution de WebSQL

• peu supporté

44

Page 45: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 : stockage

• Cache d’application

• utilisation hors ligne

• écriture d’un fichier manifest

• non supporté par IE

45

Page 46: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 géolocalisation

• récupération de la latitude/longitude

• API JavaScript : navigator.geolocation

• watchPosition() pour suivre le déplacement

46

Page 47: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 websockets

• communication bidirectionnelle

• configuration serveur spécifique

47

Page 48: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 Canvas

• graphisme dans le browser

• contrôlable par JavaScript

48

Page 49: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

HTML5 Web workers

• JavaScript est mono-thread

• traitement asynchrone

• en arrière plan

• non bloquant

49

Page 50: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 350

Page 51: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3

51

• Norme conjointe au HTML 5

• Supporté par tous les navigateurs récents

Page 52: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3

52

• Plus simple

• Meilleures performances

Page 53: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3

selecteur { propriete : valeur; propriete2 : val1, val2;}

53

Page 54: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3

• Héritage des propriétés

• Combinaisons possibles

54

h1,h2,h3 { color : blue;}

Page 55: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 sélecteurs

• Par type

• Par id

• Par classe

55

a{}

#element{}

.maClasse{}

Page 56: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 sélecteurs

• h1 p

• <p> contenus dans <h1>

• h1 > p

• <p> fils direct de <h1>

• h1 + p

• <p> juste après <h1>

56

h1 p

h1 > p

h1 + p

Page 57: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 apparence

57

margin

border

padding

content

Page 58: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 positionnement

• static

• empilement des éléments

58

Page 59: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 positionnement

• relative

• identique static

• ajustement possible

• left,right

• top,bottom

59

left: 200px;

Page 60: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 positionnement

• absolute

• indépendant

• coordonnées absolues

• left,right

• top,bottom

60

top: 0;left : 0;

top: 0;right : 0;

bottom : 0;right : 0;

Page 61: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 positionnement

• fixed

• coordonnées fixes

• fixe dans le viewport

61

bottom 0;left: 0;

Page 62: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 float

• l’élément ira aussi loin à gauche ou droite que possible

• float : left|right|none|inherit;

• l’élément suivant s’y adaptera

• pour forcer un retour : clear

62

Page 63: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 effets

• transformations

• transitions

• animations

63

Page 64: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 transform

• 2D ou 3D

• scale

• rotate

• skew

64

scale

rotate skew

Page 65: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 transition

• application au changement de style

• caractéristiques

• CSS à modifier

• durée

65

Page 66: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 animation

• permet d’animer le contenu de la page

• possibilité de définir des boucles

• déclenchées automatiquement

66

Page 67: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 media types

• permet de cibler un media en particulier

• screen

• print

• braille

• tv

67

Page 68: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 media types

• précisé dans l’inclusion de la feuille de style

<link rel="stylesheet"

href="style.css"

media="screen"/>

68

Page 69: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 media types• @media dans le fichier CSS

69

@media print { div { }}

Page 70: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 media queries

• permet d’ajouter des conditions au style

• largeur de l’écran

• résolution de l’écran

70

Page 71: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

CSS 3 media queries• expression booléenne évaluée

• cible des situations particulières

71

@media screen and orientation : portrait { div { }}

Page 72: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JavaScript72

Page 73: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JavaScript

73

• Syntaxe simple

• Héritage prototypal

Page 74: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JavaScript

74

• Importance croissante

• Performances en amélioration continue

• V8

• Nashorn

Page 75: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JSON

• JavaScript Object Notation

• Format d’échange standardisé

75

Page 76: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JSON{! "first": "John",! "last": "Doe",! "age": 39,! "sex": "M",! "salary": 70000,! "registered": true,! "favorites": {! ! "color": "Blue",! ! "sport": "Soccer",! ! "food": "Spaghetti"! } }

76

Page 77: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JSON

• Remplace le XML de plus en plus

• Compact, rapide et flexible

• Tous les navigateurs le comprennent

77

Page 78: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JQuery

78

• Bibliothèque permettant de

• manipuler le DOM

• ajouter des effets

• gérer l’AJAX

Page 79: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Pourquoi ?

• Cross-browser

• syntaxe des sélecteurs calquée sur CSS

• enrichi JavaScript

• communauté importante

79

Page 80: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Concept

• JQuery fait le lien entre le JavaScript et le HTML

• Credo

• trouver des éléments

• leur appliquer une opération

80

Page 81: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Utilisation

• jQuery("selecteur")

• trouve les éléments correspondant à "selecteur"

81

jQuery("selecteur")

jQuery(".class") == $(".class")

Page 82: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Fluent API

• Syntaxe permettant de chainer les appels

82

$("selecteur") .show() .addClass("green");

Page 83: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JQuery

• Attention aux performances

• librairie prévue pour le desktop

• poids et lenteur peuvent arriver

83

Page 84: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Micro frameworks

• Versions allégées des librairies desktop

• Adaptées au mobile

• mais pas reservées pour autant

84

Page 85: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Zepto

• Zepto (5-10ko)

• puissance des sélecteurs jQuery

• modulaire

85

Page 86: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Hammer.js

• Spécialisé dans le multitouch

• indépendant

• léger (2k)

• pinch, swipe, tap...

86

Page 87: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

microjs.com87

Page 88: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Frameworks mobiles

• Bibliothèque de composants

• Émule ou s’interface avec le natif

• Look And Feel spécifiques

88

Page 89: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

JQuery Mobile

• Dérivé du célèbre framework

• supporte les thèmes

• multi plateforme

• utilisé par beaucoup

• amélioration du HTML

89

Page 90: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

• Basé sur ExtJS

• vraie bibliothèque de composant

• style proche du natif

• courbe d’apprentissage plus élevée

90

Page 91: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Application mobile ?91

Page 92: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Web application

92

• HTML 5 + CSS 3 + JavaScript

• Web application

• L’utilisateur doit lancer son browser

• Pas la visibilité obtenue grace à un store

Page 93: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Application hybride

• Application native offrant une vue sur la webapp

• déployable dans les store

• icône dédiée

93

Page 94: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Application hybride

• Implémentation simple

• une Webview suffit !

94

Page 95: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Appareil photo 95

Page 96: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

API natives

96

• Code de compatibilité dans l’application

• interopérabilité avec le JavaScript ?

• portabilité ?

Page 97: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Frameworks

• Idée principale

• accès à toutes les spécificités

• garder un code portable

• enrichir les API JavaScript

97

Page 98: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Appcelerator titanium98

Page 99: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Frameworks

• Appcelerator Titanium

• JavaScript vers code natif

• compatibilité frameworks tiers délicate

• licence complexe

99

Page 100: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

PhoneGap100

Page 101: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

PhoneGap

• API JavaScript

• acheté par Adobe en 2011

• libéré en tant qu’Apache Cordova

101

Page 102: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

PhoneGap

• JavaScript API

• PhoneGap fait le lien

102

Page 103: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

API native103

Page 104: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

PhoneGap

PhoneGap

104

WebViewPhoneGapJavaScript

Android API provider

iOS API provider

BlackBerry API provider

Windows API provider

Page 105: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

PhoneGap:Build

• Build dans le cloud

• Très récent

• Évite toute la configuration locale

105

Page 106: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Build106

Page 107: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Architecture

107

Page 108: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Architecture

• Contenu en HTML

• Présentation en CSS

• Interactions en JavaScript

• accès API natives via PhoneGap

108

Page 109: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Applications

• Souvent connectées

• application cliente

• un serveur web

• échange JSON / XML

109

Page 110: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Côté web

• HTTP

• verbes

• transport

• implémentation libre

• technologie

110

Page 111: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Questions ?Merci de votre attention

111

Page 112: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Mini projetGestion de prêts

112

Page 113: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Mini projet

• Gestion de prêts

• DVD, Livres, Argent, ...

• Utilisation du carnet d’adresse

113

Page 114: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Mini projet

• 5 TP pour le faire

• 2 à 4 personnes

• Utilisation de PhoneGap

114

Page 115: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Mini projet

• Critères de notation

• qualité de l’interface (/5)

• qualité du code produit (/5)

• richesse fonctionnelle (/10)

115

Page 116: Applications mobiles

Pulling ITSM together Cedric Gatay - [email protected]

Ressources

• http://www.mobiledesignpatterngallery.com/mobile-patterns.php

• http://phonegap.com/

• http://caniuse.com/

Images belong to their respective authors

116