applications mobiles

Post on 06-Jul-2015

604 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Applications mobilesOne code to rule them all !

1

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Cedric GataySRMvision - Tech LeadAndroid Developer

@Cedric_Gatay

2

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Interfaces utilisateur3

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Éléments de navigation

4

• Interactions utilisateurs

• Grille

• Liste

• Onglets

• Skeumorphisme

• Carrousel

• Zone infinie

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Grille

• Balance l’importance des éléments

5

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Liste

• Efficace pour beaucoup d’éléments

6

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Onglets

• Attention à marquer la différence visuelle

7

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Skeumorphisme

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

8

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Carrousel

• Navigation dans peu d’éléments

9

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Zone infinie

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

10

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Éléments d’interface

• Inscription / Connexion

• Recherche

• Action

• Confirmation / Notification

• Premier lancement

11

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Inscription / Connexion

• Rendre facile l’inscription

12

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Recherche

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

13

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Action

• Ne pas hésiter à utiliser du texte

14

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Notifications

• Intrusif donc à utiliser avec précaution

15

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Premier lancement

• Apprendre l’utilisation à ses utilisateurs

16

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Points de vigilance

• Skeumorphisme mal choisi

• Boites de dialogue inutiles

• Non conforme aux recommendations

• Interface surchargée

17

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Mobiles18

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Points communs

19

• Capteurs

• Résolution limitée

• Connectivité limitée

• Puissance limitée

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Différences

20

• OS différents

• Environnement de développement

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Cible d’une application

• grand nombre d’utilisateurs

• grand nombre de devices

Attention au coût de développement

21

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Problématiques

• Beaucoup (trop ?) de plateformes

• Marché verrouillé

• Les utilisateurs veulent votre application peu importe leur device

22

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Problématiques

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

• Coûteux

• Difficile

23

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Une solution

• Technologies Web

• ancien ( > 15 ans)

• cible principale des mobiles

24

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Technologies Web

• standardisé

• peu coûteux

• facile à comprendre

25

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Write Once Run Anywhere26

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Tour d’horizon27

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5

28

• Certainement la seule technologie cross-platform

• simple et universel

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5

• nouveau standard du HTML

• supporté par une majorité de browsers

• http://caniuse.com

29

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Pourquoi HTML 5

Extension d’HTML 4

• nouvelles balises

• nouveaux attributs

• nouvelles API

30

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

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

31

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML Doctype

• Indispensable

• Dicte au browser le mode de parsing

32

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5

• Nouvelles balises

• séparation contenu / présentation

33

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Nouvelles balises

<section> zone de la page

<header> en-tête de section

<footer> pied de page de section

<nav> zone de navigation

34

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5 Metadata

• attribut data-* des balises

• récupérable en JavaScript

35

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5 validation

• indication du type de données

• évite la validation JavaScript

36

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5 validation

<input type="date">

<input type="email">

<input type="number">

37

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5 Forms

• autofocus

• positionne le focus sur l’élément

• placeholder

• indique le contenu attendu

38

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML 5 Forms

• required

• indique que le champ doit être rempli

• pattern

• permet de spécifier le contenu attendu

39

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 Multimedia

• <audio|video>

• inclusion de fichier son / video

• contrôlable en JavaScript

40

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 : stockage

• localStorage

• stockage clef / valeur

• associé au site

• persistant

41

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 : stockage

• sessionStorage

• perdu à la fermeture du browser

42

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 : stockage

• WebSQL

• implémentation SQL

• persistant

43

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 : stockage

• IndexedDB

• évolution de WebSQL

• peu supporté

44

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 : stockage

• Cache d’application

• utilisation hors ligne

• écriture d’un fichier manifest

• non supporté par IE

45

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 géolocalisation

• récupération de la latitude/longitude

• API JavaScript : navigator.geolocation

• watchPosition() pour suivre le déplacement

46

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 websockets

• communication bidirectionnelle

• configuration serveur spécifique

47

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 Canvas

• graphisme dans le browser

• contrôlable par JavaScript

48

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

HTML5 Web workers

• JavaScript est mono-thread

• traitement asynchrone

• en arrière plan

• non bloquant

49

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 350

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3

51

• Norme conjointe au HTML 5

• Supporté par tous les navigateurs récents

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3

52

• Plus simple

• Meilleures performances

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3

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

53

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3

• Héritage des propriétés

• Combinaisons possibles

54

h1,h2,h3 { color : blue;}

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 sélecteurs

• Par type

• Par id

• Par classe

55

a{}

#element{}

.maClasse{}

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

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

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 apparence

57

margin

border

padding

content

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 positionnement

• static

• empilement des éléments

58

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 positionnement

• relative

• identique static

• ajustement possible

• left,right

• top,bottom

59

left: 200px;

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

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;

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 positionnement

• fixed

• coordonnées fixes

• fixe dans le viewport

61

bottom 0;left: 0;

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

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

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 effets

• transformations

• transitions

• animations

63

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 transform

• 2D ou 3D

• scale

• rotate

• skew

64

scale

rotate skew

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 transition

• application au changement de style

• caractéristiques

• CSS à modifier

• durée

65

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 animation

• permet d’animer le contenu de la page

• possibilité de définir des boucles

• déclenchées automatiquement

66

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 media types

• permet de cibler un media en particulier

• screen

• print

• braille

• tv

67

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 media types

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

<link rel="stylesheet"

href="style.css"

media="screen"/>

68

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 media types• @media dans le fichier CSS

69

@media print { div { }}

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

CSS 3 media queries

• permet d’ajouter des conditions au style

• largeur de l’écran

• résolution de l’écran

70

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

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

• cible des situations particulières

71

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

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JavaScript72

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JavaScript

73

• Syntaxe simple

• Héritage prototypal

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JavaScript

74

• Importance croissante

• Performances en amélioration continue

• V8

• Nashorn

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JSON

• JavaScript Object Notation

• Format d’échange standardisé

75

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

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

76

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JSON

• Remplace le XML de plus en plus

• Compact, rapide et flexible

• Tous les navigateurs le comprennent

77

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JQuery

78

• Bibliothèque permettant de

• manipuler le DOM

• ajouter des effets

• gérer l’AJAX

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Pourquoi ?

• Cross-browser

• syntaxe des sélecteurs calquée sur CSS

• enrichi JavaScript

• communauté importante

79

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Concept

• JQuery fait le lien entre le JavaScript et le HTML

• Credo

• trouver des éléments

• leur appliquer une opération

80

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Utilisation

• jQuery("selecteur")

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

81

jQuery("selecteur")

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

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Fluent API

• Syntaxe permettant de chainer les appels

82

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

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JQuery

• Attention aux performances

• librairie prévue pour le desktop

• poids et lenteur peuvent arriver

83

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Micro frameworks

• Versions allégées des librairies desktop

• Adaptées au mobile

• mais pas reservées pour autant

84

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Zepto

• Zepto (5-10ko)

• puissance des sélecteurs jQuery

• modulaire

85

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Hammer.js

• Spécialisé dans le multitouch

• indépendant

• léger (2k)

• pinch, swipe, tap...

86

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

microjs.com87

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Frameworks mobiles

• Bibliothèque de composants

• Émule ou s’interface avec le natif

• Look And Feel spécifiques

88

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

JQuery Mobile

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

• supporte les thèmes

• multi plateforme

• utilisé par beaucoup

• amélioration du HTML

89

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

• Basé sur ExtJS

• vraie bibliothèque de composant

• style proche du natif

• courbe d’apprentissage plus élevée

90

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Application mobile ?91

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Web application

92

• HTML 5 + CSS 3 + JavaScript

• Web application

• L’utilisateur doit lancer son browser

• Pas la visibilité obtenue grace à un store

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Application hybride

• Application native offrant une vue sur la webapp

• déployable dans les store

• icône dédiée

93

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Application hybride

• Implémentation simple

• une Webview suffit !

94

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Appareil photo 95

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

API natives

96

• Code de compatibilité dans l’application

• interopérabilité avec le JavaScript ?

• portabilité ?

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Frameworks

• Idée principale

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

• garder un code portable

• enrichir les API JavaScript

97

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Appcelerator titanium98

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Frameworks

• Appcelerator Titanium

• JavaScript vers code natif

• compatibilité frameworks tiers délicate

• licence complexe

99

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

PhoneGap100

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

PhoneGap

• API JavaScript

• acheté par Adobe en 2011

• libéré en tant qu’Apache Cordova

101

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

PhoneGap

• JavaScript API

• PhoneGap fait le lien

102

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

API native103

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

PhoneGap

PhoneGap

104

WebViewPhoneGapJavaScript

Android API provider

iOS API provider

BlackBerry API provider

Windows API provider

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

PhoneGap:Build

• Build dans le cloud

• Très récent

• Évite toute la configuration locale

105

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Build106

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Architecture

107

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Architecture

• Contenu en HTML

• Présentation en CSS

• Interactions en JavaScript

• accès API natives via PhoneGap

108

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Applications

• Souvent connectées

• application cliente

• un serveur web

• échange JSON / XML

109

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Côté web

• HTTP

• verbes

• transport

• implémentation libre

• technologie

110

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Questions ?Merci de votre attention

111

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Mini projetGestion de prêts

112

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Mini projet

• Gestion de prêts

• DVD, Livres, Argent, ...

• Utilisation du carnet d’adresse

113

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Mini projet

• 5 TP pour le faire

• 2 à 4 personnes

• Utilisation de PhoneGap

114

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Mini projet

• Critères de notation

• qualité de l’interface (/5)

• qualité du code produit (/5)

• richesse fonctionnelle (/10)

115

Pulling ITSM together Cedric Gatay - c.gatay@srmvision.com

Ressources

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

• http://phonegap.com/

• http://caniuse.com/

Images belong to their respective authors

116

top related