introduction à android - janvier 2011
DESCRIPTION
TRANSCRIPT
![Page 1: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/1.jpg)
Informatique mobile, ubiquitaire et diffuse
Introduction à Android
![Page 2: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/2.jpg)
2Informatique mobile, ubiquitaire et diffuse
Ma formation, mon expérience, mon entreprise
![Page 3: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/3.jpg)
3Informatique mobile, ubiquitaire et diffuse
Présentation
● Aurélien Guillard● Développeur Mobile multiplateforme
– (Android, iPhone, Blackberry)– Lead Developer Android
● Contact● [email protected]
[email protected]● http://www.aurelienguillard.com● Twitter : @rorolepro (oui, je sais, ce pseudo est ridicule)
![Page 4: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/4.jpg)
4Informatique mobile, ubiquitaire et diffuse
Formation
● 2010 : Ingénieur Réseau et Multimédia● Ecole Supérieure d'Ingénieurs de Luminy
● 2007 : DUT SRC● IUT de Laval
● 2005 : BAC S option SI● Lycée d'une petite ville près de Nantes
![Page 5: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/5.jpg)
5Informatique mobile, ubiquitaire et diffuse
Expériences professionnelles
● Actuellement : Clicmobile (Android, iPhone, Blackberry)
● 2009 : Latin 3G S.A. de C.V. (Android)
● 2008 : GAROS (web)
● 2007 : e-doceo (ActionScript)
● 2006 : SA2EI (web)
![Page 6: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/6.jpg)
6Informatique mobile, ubiquitaire et diffuse
Clicmobile
● Conseils stratégiques● Création et développement● Marketing et promotion● Statistiques d'usage
![Page 7: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/7.jpg)
7Informatique mobile, ubiquitaire et diffuse
Clicmobile web framework
● Genération de backoffice d'applications● Génération de WebServices
● JSON● XML● PLIST
![Page 8: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/8.jpg)
8Informatique mobile, ubiquitaire et diffuse
Clicmobile Analytics
![Page 9: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/9.jpg)
9Informatique mobile, ubiquitaire et diffuse
Le métier au quotidien
● Estimation● Conception et architecture● Développement applications et librairies● Tests● Corrections et améliorations● Veille technologique
![Page 10: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/10.jpg)
10Informatique mobile, ubiquitaire et diffuse
Android ?
![Page 11: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/11.jpg)
11Informatique mobile, ubiquitaire et diffuse
Android
● Startup rachetée par Google en 2007● OS open-source
● Terminaux mobiles● Systèmes embarqués
● Développement ● Java/XML (SDK) ● C (NDK)
![Page 12: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/12.jpg)
12Informatique mobile, ubiquitaire et diffuse
Une hausse constante
![Page 13: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/13.jpg)
13Informatique mobile, ubiquitaire et diffuse
Les versions
● 3.0 : Honeycomb● 2.3 : Gingerbread● 2.2 : FroYo● 2.1 : Eclair● 1.6 : Donut● 1.5 : Cupcake Data collected during two weeks ending on January 4, 2011
![Page 14: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/14.jpg)
14Informatique mobile, ubiquitaire et diffuse
Les terminaux
SonyXperia X10 Mini
240x320
HTCMagic
320x480
MotorolaMilestone480x854
SamsungGalaxy Tab600x1024
Un parc très varié : smartphones, tablettes, tv, autoradio...
![Page 15: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/15.jpg)
15Informatique mobile, ubiquitaire et diffuse
Boutons physiques
HomeBack Search (optionnel)Menu
![Page 16: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/16.jpg)
16Informatique mobile, ubiquitaire et diffuse
Android != iPhone
UINavigationBarController
UITabController
Tentative de reproduction de
"controllers" iPhone...
![Page 17: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/17.jpg)
17Informatique mobile, ubiquitaire et diffuse
Les éléments de UI (User Interface)
![Page 18: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/18.jpg)
18Informatique mobile, ubiquitaire et diffuse
ScrollView + Options Menu
TextView
ScrollView
Options Menu(clic sur le bouton physique "menu")
![Page 19: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/19.jpg)
19Informatique mobile, ubiquitaire et diffuse
ProgressDialog
STYLE_SPINNER
![Page 20: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/20.jpg)
20Informatique mobile, ubiquitaire et diffuse
Dialog
Custom dialog
TextView
EditText
Button
![Page 21: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/21.jpg)
21Informatique mobile, ubiquitaire et diffuse
ImageView
ImageView
TextView
TextView
![Page 22: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/22.jpg)
22Informatique mobile, ubiquitaire et diffuse
TabHost
TabWidget
FrameLayoutListView
![Page 23: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/23.jpg)
23Informatique mobile, ubiquitaire et diffuse
MapView
Pas disponible dans le framework standard nécessite la lib Google APIs
com.google.android.maps.MapView
![Page 24: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/24.jpg)
24Informatique mobile, ubiquitaire et diffuse
Outils de développement
![Page 25: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/25.jpg)
25Informatique mobile, ubiquitaire et diffuse
Outils de développement
● Eclipse● http://www.eclipse.org/downloads/
● ADT plugin● https://dl-ssl.google.com/android/eclipse/
● Android SDK (Windows, Linux, MacOS)● http://developer.android.com/sdk/
● Téléchargement des plateformes depuis le SDK and AVD Manager
![Page 26: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/26.jpg)
26Informatique mobile, ubiquitaire et diffuse
SDK and AVD Manager
![Page 27: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/27.jpg)
27Informatique mobile, ubiquitaire et diffuse
Création d'émulateurs
![Page 28: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/28.jpg)
28Informatique mobile, ubiquitaire et diffuse
DDMS
![Page 29: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/29.jpg)
29Informatique mobile, ubiquitaire et diffuse
Composition d'un projet Android
![Page 30: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/30.jpg)
30Informatique mobile, ubiquitaire et diffuse
Arborescence d'un projet
Java
Images
XML
Strings
Manifest
FrameworkGenerated java files
![Page 31: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/31.jpg)
31Informatique mobile, ubiquitaire et diffuse
Composants d'application
● Activities● Services● Broadcast receivers● Content providers
![Page 32: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/32.jpg)
32Informatique mobile, ubiquitaire et diffuse
Arborescence de l'application
PhotosetListActivity ContainerActivity
PhotosActivity
PhotosListActivity PhotosMapActivity
![Page 33: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/33.jpg)
33Informatique mobile, ubiquitaire et diffuse
Intents
● Système de messages pour exécuter un composant (activity, service, broadcast receiver)
● Possibilité d'exécuter des composants d'une même application OU/ET d'applications différentes
● Android tente de répondre le mieux à chaque Intent (explicit/implicit intents)
![Page 34: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/34.jpg)
34Informatique mobile, ubiquitaire et diffuse
Activity life cycle
![Page 35: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/35.jpg)
35Informatique mobile, ubiquitaire et diffuse
Manifest.xml
Permissions
Plateforme cible
Activities
Numéros de versions
Intent filters
![Page 36: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/36.jpg)
36Informatique mobile, ubiquitaire et diffuse
Création des vues
![Page 37: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/37.jpg)
37Informatique mobile, ubiquitaire et diffuse
Une vue est décrite en XML
![Page 38: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/38.jpg)
38Informatique mobile, ubiquitaire et diffuse
Assigner un layout XML à une Activity
Generated Class File Type de ressource Nom de la ressource
![Page 39: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/39.jpg)
39Informatique mobile, ubiquitaire et diffuse
XML Inflate
![Page 40: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/40.jpg)
40Informatique mobile, ubiquitaire et diffuse
Gestion des ressources
![Page 41: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/41.jpg)
41Informatique mobile, ubiquitaire et diffuse
Types de ressource
● anim/● color/● drawable/● layout/● menu/● raw/● values/● xml/
![Page 42: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/42.jpg)
42Informatique mobile, ubiquitaire et diffuse
Drawable auto-scaling
Même image, même nom de fichier, mais dans des dossiers
différents, chacun lié à une densité différente
(low, medium, high)
icon72x72
icon36x36
icon48x48
![Page 43: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/43.jpg)
43Informatique mobile, ubiquitaire et diffuse
Resource qualifiers● MCC and MNC : mcc310 mcc310-mnc004 mcc208-mnc00 etc.
● Langage and region : en fr en-rUS fr-rFR fr-rCA etc.
● Screen size : small normal large xlarge
● Screen aspect : long notlong
● Screen orientation : port land
● Dock mode : car desk
● Night mode : night notnight
● Screen pixel density : ldpi mdpi hdpi xhdpi nodpi
● Touchscreen type : notouch stylus finger
● Keyboard availability : keysexposed keyssoft
● Primary text input method : nokeys qwerty 12key
● Navigation key availability : navexposed navhidden
● Primary non-touch navigation method : nonav dpad trackball wheel
● System version (API level) : v3 v4 v7 etc.
![Page 44: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/44.jpg)
44Informatique mobile, ubiquitaire et diffuse
Connexion à un WebService
![Page 45: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/45.jpg)
45Informatique mobile, ubiquitaire et diffuse
Flickr API
● Formats de requête● REST, XML-RPC, SOAP
● Formats de réponse● REST, XML-RPC, SOAP, JSON, PHP
● Flickr App Garden● http://www.flickr.com/services/api/
![Page 46: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/46.jpg)
46Informatique mobile, ubiquitaire et diffuse
Couches applicatives
WebServiceAPIManagerContentManagerActivity
savePhotos(id) getPhotos(id) flickr.photosets.getPhotos
File responseStringJava object
![Page 47: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/47.jpg)
47Informatique mobile, ubiquitaire et diffuse
Réponse API Flickr
![Page 48: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/48.jpg)
48Informatique mobile, ubiquitaire et diffuse
APIManager
● Connexion à l'API REST● Appel non signé, sans jeton d'utilisateur● Méthode GET
![Page 49: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/49.jpg)
49Informatique mobile, ubiquitaire et diffuse
ContentManager
![Page 50: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/50.jpg)
50Informatique mobile, ubiquitaire et diffuse
Sauvegarde des données
![Page 51: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/51.jpg)
51Informatique mobile, ubiquitaire et diffuse
Shared Preferences
● Accès : privé● Type : primitif (boolean, float, int, long, string)● Format : clé/valeur
● Utilisé pour sauvegarder des paramètres
![Page 52: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/52.jpg)
52Informatique mobile, ubiquitaire et diffuse
Internal Storage
● Accès : privé● Format : fichier
![Page 53: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/53.jpg)
53Informatique mobile, ubiquitaire et diffuse
External Storage
● Accès : public● Format : fichier
● Nécessite des vérifications : média monté sur une machine, absent, accessible qu'en lecteur, etc.
● Sauvegarder ses fichiers dans :/Android/data/<package_name>/files/
![Page 54: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/54.jpg)
54Informatique mobile, ubiquitaire et diffuse
Databases
● Accès : privé● Format : données structurées● Type : SQLite
![Page 55: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/55.jpg)
55Informatique mobile, ubiquitaire et diffuse
SQLiteOpenHelper
![Page 56: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/56.jpg)
56Informatique mobile, ubiquitaire et diffuse
Android Market
![Page 57: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/57.jpg)
57Informatique mobile, ubiquitaire et diffuse
Client Android Market
![Page 58: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/58.jpg)
58Informatique mobile, ubiquitaire et diffuse
Client Android Market
Une seule page par application
Promotional Graphic (or icon)Description (4000 chars)
Screenshots (8)Avis
Applications semblablesInformations sur le développeur
Contenu Android Market
![Page 59: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/59.jpg)
59Informatique mobile, ubiquitaire et diffuse
Android Market Admin
Peu de statistiques...
![Page 60: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/60.jpg)
60Informatique mobile, ubiquitaire et diffuse
Upload Assets
Android Market web ?Google TV ?
![Page 61: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/61.jpg)
61Informatique mobile, ubiquitaire et diffuse
Listing details
![Page 62: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/62.jpg)
62Informatique mobile, ubiquitaire et diffuse
Publishing options« If you want porn, get an Android » – Steve Jobs
![Page 63: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/63.jpg)
63Informatique mobile, ubiquitaire et diffuse
Liens
![Page 64: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/64.jpg)
64Informatique mobile, ubiquitaire et diffuse
Documentation et examples
● http://developer.android.com● http://code.google.com/p/android-cookbook/● http://code.google.com/p/apps-for-android/● http://www.androidsnippets.org
![Page 65: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/65.jpg)
65Informatique mobile, ubiquitaire et diffuse
Actualités
● http://www.frandroid.com● http://www.pointgphone.com
![Page 66: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/66.jpg)
66Informatique mobile, ubiquitaire et diffuse
Aide
● http://forum.xda-developers.com● http://www.anddev.org● http://forum.frandroid.com
● https://groups.google.com/group/paris-android-ug
![Page 67: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/67.jpg)
67Informatique mobile, ubiquitaire et diffuse
Utilitaires
● http://code.google.com/p/android-ui-utils/● http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html● http://www.droidthing.com
![Page 68: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/68.jpg)
68Informatique mobile, ubiquitaire et diffuse
Livres
![Page 69: Introduction à Android - Janvier 2011](https://reader033.vdocuments.net/reader033/viewer/2022051513/54788f555806b567048b4574/html5/thumbnails/69.jpg)
69Informatique mobile, ubiquitaire et diffuse
Merci de votre attention !J'ai hâte de tester vos applications;)