Presentation Android

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Presentation Android - Presentation Transcript

    1.              Introduction à Android by Jean Collas, Ghislain Deffrasne, Reda Sebbaniis licensed under a Creative Commons Attribution 2.0 France License.
      Original at http://www.jean-collas.fr/android
    2. Ouverture
      Jean Collas, Réda Sebbani, Ghislain Deffrasnes
    3. Contexte
      Contexte
      3
      Téléphonie Mobile : Smart Phone
      Développement logiciel pour mobiles
      Chiffre d’affaire énorme
      Windows Mobile
      RIM
      40 millions de smartphones / trimestre (2008)
      Symbian
      iPhone OS
    4. Contexte Concurrentiel
      4
      Systèmes d’exploitation pour Mobiles :
      Marché en constante augmentation
      Possibilités d’évolution énormes avec un bon produit
    5. Contexte Concurrentiel
      5
      Systèmes d’exploitation pour Smart phone :
      Marché en constante augmentation (+28% en 1 an, 31M -> 40M)
      Possibilités d’évolution énormes avec un bon produit
    6. Internet & Google
      6
      Fondé en 98, croissance constante
      Multiples domaines de l’informatique :
      Recherche, cartographie, vidéo, conception 3D, suite bureautique, publicité, navigateur, …
      Politique de financement par la publicité
      Attaque du monde mobile par la source :
      le système d’exploitation Android
    7. Points forts d’Android
      Points fort d’Android
      7
      Point de vue constructeur
      Point de vue utilisateur
      Point de vue développeur
      Point de vue bidouilleur
      Système Linux + Java
      Système fonctionnel, intuitif, évolutif
      Application développées en syntaxe Java
      SDK complet fourni
      Projet Open Source
      C++ / Java
    8. Historique
      Historique
      8
      T-Mobile G1
      Novembre 2008
      Android 1.0 et SDK release 2
      Android : Open Source
      Octobre 2008
      Android 1.0 et SDK release 1
      Septembre 2008
      AndroidMarket
      Août 2008
      Avril 2008
      Développement
      d’Android
      Developer
      Challenge
      Open Handset Alliance
      Annonce d’Android
      SDK pour Android
      Novembre 2007
      Start-up Android
      Août 2005
    9. Open Handset Alliance
      9
      • Consortium créé fin 2007
      • 47 compagnies
      Fabricants de semi-conducteurs
      Opérateurs de téléphonie mobile
      Entreprises de commercialisation
      Fabricants d'appareils mobiles
      Fabricants de logiciels
      • But : développer des normes ouvertes pour les appareils de téléphonie mobile
    10. T-Mobile G1
      T-Mobile G1 (HTC)
      10
      • 1ertéléphone avec Android
      • De 180 à 400 $
      • Wi-fi et Bluetooth
      • GPS
      • Accéléromètres
      • Caméra
      • Écran tactile
    11. De nouveaux mobiles
      11
      LG
      L’agora par Kogan
      http://www.businessmobile.fr/solutions-mobiles/guides-mobilite/0,39044672,39220692,00.htm
    12. Matériel Recommandé
      12
      • RAM : 128 Mo (minimum requis)
      • Mémoire Flash : 256 Mo (minimum requis)
      • Wifi : 802.11 b/g
      • USB : interface USB 2.0
      • Bluetooth 2.0 EDR
      • Caméra
      • Périphérique de stockage externe
      • Écran :
      • Résolution HVGA (480 × 320 pixels)
      • Couleurs 16 bits
    13. Preuve de sa portabilité – Futur d’Android
      13
      Et si Android n’était pas seulement conçu pour les smartphone?
      Android sur un NetBook
    14. Développementd’Applications
      14
      Possibilité de créer ses propres applications
      Environnement de développement
      Android SDK
      Plugin Eclipse
      Émulateur, outils de débuggage, etc…
      Langage Java
      ?
    15. Intégration des applications Google
      15
      Barre de recherche « Google Search »
      Gmail
      Google Talk (IM)
      Navigateur Web
      Gmaps
      Google StreetView
    16. Exemples d’applications : Android Market
      16
      Géolocalisation
      Orientation
      Tourisme
      Géolocalisation
      Travail
      Voisinage
      Google Maps
      Voyage
      Achats
      Covoiturage
    17. Points d’accès d’Android
      17
      Point de vue constructeur
      Point de vue utilisateur
      Point de vue développeur
      Point de vue bidouilleur
      Système Linux + Java
      Système fonctionnel, intuitif, évolutif
      Application développées en syntaxe Java
      SDK complet fourni
      Projet Open Source
      C++ / Java
    18. Architecture
      18
      APPLICATIONS
      Home
      Contacts
      Phone
      Browser

      APPLICATION FRAMEWORK
      Activity Manager
      Window Manager
      Content Providers
      View System
      Package Manager
      Telephony Manager
      Resource Manager
      Location Manager
      Notification Manager
      ANDROID RUNTIME
      JNI
      LIBRARIES
      CoreLibraries
      Surface Manager
      Media Framework
      SQL Lite
      Dalvik Virtual Machine
      OpenGL
      Audio Manager
      WebKit
      SGL
      SSL
      Libc
      LINUX KERNEL
      Display Driver
      Camera Driver
      Flash Memory Driver
      Binder (IPC) Driver
      Keypad Driver
      WiFi Driver
      Audio Driver
      Power Management
    19. Noyau d’Android
      19
      Architecture ARM
      Basé sur Linux 2.6.24
      Système de fichiers supporté : FAT32
      Support de TCP/IP, UDP,…
      HARDWARE ABSTRACTION LAYER
      Graphics
      Audio
      Camera
      Bluetooth
      GPS
      WiFi

      LINUX KERNEL
      Display Driver
      Camera Driver
      Flash Memory Driver
      Binder (IPC) Driver
      Keypad Driver
      WiFi Driver
      Audio Driver
      Power Management
    20. Adaptation aux besoins du mobile
      20
      • Alarm : timers pour « réveiller » des périphériques
      • Ashmem : partage de mémoire entre processus
      • Binder : driver IPC pour la communication inter-processus
      • Power Management
      • Low Memory Killer
      • Kernel Debugger
      • Logger
      HARDWARE ABSTRACTION LAYER
      Graphics
      Audio
      Camera
      Bluetooth
      GPS
      WiFi

      LINUX KERNEL
      Display Driver
      Camera Driver
      Flash Memory Driver
      Binder (IPC) Driver
      Keypad Driver
      WiFi Driver
      Audio Driver
      Power Management
    21. Librairies
      21
      LIBRARIES
      Surface Manager
      Media Framework
      SQL Lite
      OpenGL
      Audio Manager
      WebKit
      SGL
      SSL
      Libc
      LINUX KERNEL
      Display Driver
      Camera Driver
      Flash Memory Driver
      Binder (IPC) Driver
      Keypad Driver
      WiFi Driver
      Audio Driver
      Power Management
    22. Surface Manager
      22
      Application 1
      Surface Flinger
      Application 2
      Écran
      (Frame Buffer)
    23. Audio Manager
      23
      Sonnerie d’appel
      Audio Flinger
      Oreillette
      Lecteur MP3
      Écouteurs
    24. Machine Virtuelle Dalvik
      24
      ANDROID RUNTIME
      LIBRARIES
      CoreLibraries
      Surface Manager
      Media Framework
      SQL Lite
      Dalvik Virtual Machine
      OpenGL
      Audio Manager
      WebKit
      SGL
      SSL
      Libc
      LINUX KERNEL
      Display Driver
      Camera Driver
      Flash Memory Driver
      Binder (IPC) Driver
      Keypad Driver
      WiFi Driver
      Audio Driver
      Power Management
    25. Machine Virtuelle Dalvik
      25
      Nouvelle instance pour chaque processus : Applications indépendantes
      Exécute des fichiers .dex (Dalvik Executable)
      Dalvik core class library fournit une base de développement proche de java SE, adapté au mobile
    26. Framework & fondationsdes applications
      26
      APPLICATION FRAMEWORK
      Activity Manager
      Window Manager
      Content Providers
      View System
      Package Manager
      Telephony Manager
      Resource Manager
      Location Manager
      Notification Manager
      ANDROID RUNTIME
      JNI
      LIBRARIES
      CoreLibraries
      Surface Manager
      Media Framework
      SQL Lite
      Dalvik Virtual Machine
      OpenGL
      Audio Manager
      WebKit
      SGL
      SSL
      Libc
      LINUX KERNEL
      Display Driver
      Camera Driver
      Flash Memory Driver
      Binder (IPC) Driver
      Keypad Driver
      WiFi Driver
      Audio Driver
      Power Management
    27. Intents
      27
      Intent :
      • Requête; Description d’une action à effectuer
      • Fait le lien entre différentes applications
      Décrit par :
      • Une action(VIEW, EDIT, MAIN,…)
      • La donnée à traiter (sous forme d’URI)
      Types d’Intent :
      • Explicite (référence exacte)
      • Implicite (description)
    28. Intents
      28
      Intent Resolver
      Intent 1 App.A
      Intent 2 App.B
      .
      .
      Publication
      Edit ContactContacts
      View Contact Contacts
      IntentFilter
      VIEW
      EDIT
      StartActivity(View Contact)
      1
      2
      Echange
      3
      Messagerie
      Contacts
    29. 29
      Intent Filter
      Objectif : Description du handler
      Publication d’IntentFilters par les activités
      IntentFilter décrivent les capacités de l’application.
      <intent-filter>
      <actionandroid:value="android.intent.action.VIEW"/>
      <actionandroid:value="android.intent.action.EDIT"/>
      <actionandroid:value="android.intent.action.PICK"/>
      <category android:value="android.intent.category.DEFAULT" />
      <type
      android:value="vnd.android.cursor.dir/vnd.google.contact" />
      </intent-filter>
    30. Les URIs - Utilisation
      30
      Exemples d’URI:
      Intent
      EDIT_ACTION
      Ouvre l’application de géo-localisation à la position donnée (latitude, longitude).
      VIEW_ACTION
      geo:
      tel:
      125
      people/
      content:
      google.streetview:
      //contacts/
      25,32
      123
      cbll=25,32
      Appelle le numéro 123
      CALL_ACTION
      VIEW_ACTION
      &cbp=1,yaw,,pitch,zoom
      void startActivity(Intent intent) ;
      void sendBroadcast(Intent intent)boolean bindService(Intent service, int flags)
      ComponentName startService(Intent service)
    31. Notification Manager
      31
      Applications peuvent s’exécuter simultanément
      Barre de notifications
      Notificationsd’événements du background
      Mise en place facilité par le Notification Manager
      Différentes formes de notifications :
      • LED
      • Son
      • Vibreur
      • Barre de notification (icône)
    32. Composants d’une application
      32
      Activity
      Broadcast Receiver
      Service
      Content Provider
    33. ContentProvider
      33
      SYSTEM
      APK
      APK
      service
      Activity
      service
      Activity
      Activity
      SQLite
      Data
      XML
      Remote data
    34. ContentProvider
      34
      SYSTEM
      APK
      APK
      service
      Activity
      service
      Activity
      Activity
      ContentProvider
      SQLite
      Data
      XML
      Remote data
    35. Les URIs
      35
      Exemples d’URI d’un content provider:
      Activity
      IntentReceiver
      Service
      Content Provider
      125
      people/
      content:
      53
      users/
      content:
      //contacts/
      //com.maCompanie.monApp/
      A
      Préfixe d’accès aux données, type d’URI
      B
      Identifiant ou type du content provider à consulter
      C
      0 ou plusieurs segments, permettent de déterminer le type de données
      D
      Enregistrement spécifique éventuellement demandé (identifiant, référence)
      <providerclass=".NotePadProvider"android:authorities="com.google.provider.NotePad"/>
    36. ContentProvider
      36
      125
      people/
      content:
      URI :
      //contacts/
      Activity
      IntentReceiver
      Content Providers
      Applications
      Service
      Content Provider
      URI
      Browser
      Annuaire
      Settings
      ContentResolver
      + delete()
      + insert()
      + notifyChange()
      + query()
      + update()
      Résultat
      Contacts
      Lecteur MP3
      MediaStore.Images
      MediaStore.Audio
    37. Activity
      37
      Objet qui possède un cycle de vie
      Code qui réalise un traitement
      Activity
      IntentReceiver
      Point d’entrée d’une application
      Service
      Content Provider
      Généralement, uneActivityafficheune UI
      <activityclass=".NoteEditor"android:label="@string/title_note">
      <intent-filterandroid:label="@string/resolve_edit">
      <actionandroid:value="android.intent.action.VIEW"/>
      <actionandroid:value="android.intent.action.EDIT"/>
      <categoryandroid:value="android.intent.category.DEFAULT"/>
      <typeandroid:value="vnd.android.cursor.item/vnd.google.note"/>
      </intent-filter>
      </activity>
    38. Broadcast receiver
      38
      Broadcast receiver permet de réagir à des évènements extérieurs à l’application
      Activity
      BroadcastReceiver
      Service
      Content Provider
      .
      Permet de réveiller une application
      Un Intent peut être boadcasté; on peut utiliser un broadcast receiver pour gérer ce type d’evt
      Permet également de réagir à des notification du système (évènements extérieurs/matériels).
      <receiverandroid:name=".app.OneShotAlarm"android:process=":remote"/>
       
    39. Service
      39
      Activity
      IntentReceiver
      Composante sans GUI
      Activité de longue durée
      Service
      Content Provider
      Service interne : Context.startService()
      Service externe : Context.bindService()
      Communication via une interface
      Ex Media Player : pause, lecture, stop, etc
    40. Service : AndroidManifest
      40
      Activity
      IntentReceiver
      <serviceandroid:name=".app.RemoteService"android:process=":remote">
      <intent-filter>
      <!-- These are the interfaces supported by the service, which
      you can bind to. -->
      <actionandroid:name="com.example.android.apis.app.IRemoteService"/>
      <!-- This is an action code you can use to select the service
      without explicitly supplying the implementation class. -->
      <actionandroid:name="com.example.android.apis.app.REMOTE_SERVICE"/>
      </intent-filter>
      </service>
      Service
      Content Provider
    41. AndroidManifest complet
      41
      <manifestxmlns:android="http://schemas.android.com/apk/res/android"
      package="com.android.notepad">
      <applicationandroid:icon="@drawable/app_notes"android:label="@string/app_name">
      <activityclass=".NotesList"android:label="@string/title_notes_list">
      <intent-filter>
      <actionandroid:value="android.intent.action.MAIN"/>
      <categoryandroid:value="android.intent.category.LAUNCHER"/>
      </intent-filter>
      </activity>
      <providerclass=".NotePadProvider"android:authorities="com.google.provider.NotePad"/> 
      <serviceandroid:name=".app.RemoteService"android:process=":remote">
      <intent-filter>
      <actionandroid:name="com.example.android.apis.app.IRemoteService"/>
      </intent-filter>
      </service>
      <receiverandroid:name=".app.OneShotAlarm"android:process=":remote"/>
      </application>
      </manifest>
      Activity
      IntentReceiver
      Activity
      Service
      Content Provider
      Content Provider
      Service
      IntentReceiver
    42. Cycle de vie d’une Activité
      42
      OnCreate()
      Allocation des ressources
      Activity
      IntentReceiver
      OnStart()
      Affichage à l’écran
      Service
      Content Provider
      Running
      OnResume()
      Passage au premier plan
      Paused
      4 états :
      • active/running
      • paused
      • stopped
      • killed/shut down
      OnPause()
      Passage en arrière plan
      Stopped
      OnStop()
      Arrêt de l’exécution
      Killed
      OnDestroy()
      Libération des ressources
    43. Cycle de vie d’une Activité
      43
      Retour à l’application
      New Activity
      1. OnCreate()
      2. OnStart()
      3. OnResume()
      Application
      Killed
      Running
      (Foreground)
      OnFreeze()
      OnPause()
      OnResume()
      Besoin de mémoire
      3. OnResume()
      2. OnStart()
      1. OnRestart()
      Paused
      (Background)
      Application plus visible
      OnStop()
      Stopped
      (Plus visible)
      L’utilisateur quitte
      OnDestroy()
      Destroyed
    44. Hiérarchie des processus
      44
      Hiérarchie des processus
      ForegroundProcess
      Activité
      Importance
      Visible Process
      Activité en arrière plan
      Processus des composants « Service » disponibles en arrière plan
      Service Process
      Background Process
      Processus en arrière plan, non visible.
      EmptyProcess
      Cache pour les processus
    45. Les applications
      45
      APPLICATIONS
      Home
      Contacts
      Phone
      Browser

      APPLICATION FRAMEWORK
      Activity Manager
      Window Manager
      Content Providers
      View System
      Package Manager
      Telephony Manager
      Resource Manager
      Location Manager
      Notification Manager
      ANDROID RUNTIME
      JNI
      LIBRARIES
      CoreLibraries
      Surface Manager
      Media Framework
      SQL Lite
      Dalvik Virtual Machine
      OpenGL
      Audio Manager
      WebKit
      SGL
      SSL
      Libc
      LINUX KERNEL
      Display Driver
      Camera Driver
      Flash Memory Driver
      Binder (IPC) Driver
      Keypad Driver
      WiFi Driver
      Audio Driver
      Power Management
    46. Développement en Java : Méthode classique
      46
      packagecom.android.hello;
       
      import android.app.Activity;
      importandroid.os.Bundle;
      importandroid.widget.TextView;
       
      publicclassHelloAndroidextends Activity {
      /**Calledwhentheactivityisfirstcreated.*/
      @Override
      publicvoidonCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      TextViewtv = newTextView(this);
      tv.setText("Hello, Android");
      setContentView(tv);
      }
      }
      HelloAndroid.java
      JAVA
      (uniquement)
      1 champ de texte
    47. Séparation Présentation / Métier
      47
      packagecom.android.hello;
       
      import android.app.Activity;
      importandroid.os.Bundle;
      importandroid.widget.TextView;
       
      publicclassHelloAndroidextends Activity {
      /**Calledwhentheactivityisfirstcreated.*/
      @Override
      publicvoidonCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      }
      }
      HelloAndroid.java
      JAVA
      métier
      <?xmlversion="1.0"encoding="utf-8"?>
      <TextViewxmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:text="@string/hello"/>
      XML
      vues
      main.xml
    48. Interfaçage des ressources
      48
      Génération automatique
      Description du layout
      packagecom.android.hello;
       
      publicfinalclass R {
      publicstaticfinalclassattr {
      }
      publicstaticfinalclassdrawable {
      publicstaticfinalint icon=0x7f020000;
      }
      publicstaticfinalclass layout {
      publicstaticfinalint main=0x7f030000;
      }
      publicstaticfinalclass string {
      publicstaticfinalintapp_name=0x7f040001;
      publicstaticfinalint hello=0x7f040000;
      }
      }
      R.java
      icon.png
      Image
      main.xml
      Description du layout
      strings.xml
      Étiquettes Texte
    49. HelloWorld : AndroidManifest.xml
      49
      <?xmlversion="1.0"encoding="utf-8"?>
      <manifestxmlns:android="http://schemas.android.com/apk/res/android"
      package="com.android.hello"
      android:versionCode="1"
      android:versionName="1.0.0">
      <applicationandroid:icon="@drawable/icon"android:label="@string/app_name">
      <activityandroid:name=".HelloAndroid"
      android:label="@string/app_name">
      <intent-filter>
      <actionandroid:name="android.intent.action.MAIN"/>
      <categoryandroid:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      </activity>
      </application>
      </manifest>
    50. Compilation et Déploiement d’une Application
      50
      Byte-code (optimisé)
      Sources
      .dex
      .java
      .class
      .png
      .xml
      .apk
      /data/app/
      Ressources + Manifest
      Application compilée
    51. HelloWorld
      51
    52. Vidéos StreetView + Compass
      52
    53. ?
      Vidéos StreetView + Compass
      53
    54. Vidéo StreetView + Compass
      55
    55. Vidéo StreetView + Compass
      56
    56. 57
      Symbian's chief technical advantage today is the platform's maturity, and
      more recently, its real-time kernel.
      ?
    57. Annexe 1 : Les partenaires de l’OpenHanset Alliance
      58
    58. Cycle de vie d’une Activité
      59
      OnCreate()
      Retour à l’application
      Activity
      IntentReceiver
      OnStart()
      Service
      Content Provider
      Application killed
      OnResume()
      OnRestart()
      A refaire (diag d’états)
      Autre activité lancée
      Activité plus visible
      Passage au premier plan
      Passage au premier plan
      OnPause()
      Besoin de mémoire pour une application plus prioritaire
      OnStop()
      OnDestroy()
    59. IPC
      60
      IPC, Binder, AIDL
      Lightweigth, powerful mean
      Binder : driver for IPC
      Appelssynchones entre processus
      Passage de paramètres
      • AIDL : Android Interface Definition Language
      • IDL pour réaliser une communication interprocessus (IPC)
      When a “Service” isusing IPC, an AIDL description of itsfeaturesisalsoneeded.
      • Android Interface DefinitionLanguage (AIDL) isused to generate code to allow communication betweentwoprocessesthrough IPC
      • This mechanismis interface-based, similar to Corba (Unix) or COM (windows) but Iighterweight
      • Withthisspecific mode, the ‘Service” isstartedthrough the binder and not with“startService()”
      ? A refaire ?
    60. 61
      Booter Android
      ?
    SlideShare Zeitgeist 2009

    + Jean CollasJean Collas Nominate

    custom

    329 views, 0 favs, 0 embeds more stats

    Présentation & Introduction à Android au 01/2009 more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 329
      • 329 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories