SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
Introduction à Android by Jean Collas, Ghislain Deffrasne, Reda Sebbani is licensed
                         under a Creative Commons Attribution 2.0 France License.
                                         Original at http://www.jean-collas.fr/android
Ouverture




Jean Collas, Réda Sebbani, Ghislain Deffrasnes
Contexte
Contexte

             Téléphonie Mobile : Smart Phone

             Développement logiciel pour mobiles

             Chiffre d’affaire énorme
Windows                                                            RIM
 Mobile
             40 millions de smartphones / trimestre (2008)




                                                             Symbian
 iPhone OS
Contexte Concurrentiel

Systèmes d’exploitation pour Smart phone :

                                                                 70%
                                                                 60%
                                                                50%
                                                                40%
                                                                30%
                                                               20%
                                                               10%
                                                               0%
                                                              2007
                                                         2008




Marché en constante augmentation (+28% en 1 an, 31M -> 40M)
Possibilités d’évolution énormes avec un bon produit
Internet & Google


       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
Points forts d’Android
Points fort d’Android

   Point de vue constructeur    Point de vue utilisateur

                                 Système fonctionnel,
     Système Linux + Java
                                    intuitif, évolutif



   Point de vue bidouilleur    Point de vue développeur
                               Application développées
      Projet Open Source
                                   en syntaxe Java
           C++ / Java
                                 SDK complet fourni
Historique
                                  Novembre 2008
  Android 1.0 et SDK release 2
                                                       T-Mobile G1
                                   Octobre 2008
                                                   Android : Open Source
  Android 1.0 et SDK release 1    Septembre 2008

                                                    Android Market
                                    Août 2008

                                    Avril 2008




                                   Developer
                                   Challenge
     Open Handset Alliance
                                  Novembre 2007
       Annonce d’Android
        SDK pour Android

                                 Développement
                                   d’Android

                                                   Start-up Android
                                    Août 2005
Open Handset Alliance
   Consortium créé fin 2007                       47 compagnies

 Fabricants de semi-conducteurs
                                                Opérateurs de téléphonie mobile




 Fabricants d'appareils mobiles                   Entreprises de commercialisation



                                  Fabricants de logiciels



            But : développer des normes ouvertes pour les
             appareils de téléphonie mobile
T-Mobile G1
T-Mobile G1 (HTC)


     1er téléphone avec Android
     De 180 à 400 $
     Wi-fi et Bluetooth
     GPS
     Accéléromètres
     Caméra
     Écran tactile
De nouveaux mobiles


       LG




                      L’agora par Kogan
Preuve de sa portabilité – Futur d’Android



 Et si Android n’était pas seulement
 conçu pour les smartphone?



 Android sur un NetBook
Intégration des applications Google



         Barre de recherche « Google Search »
         Gmail
         Google Talk (IM)
         Navigateur Web
         Gmaps
         Google StreetView
Exemples d’applications : Android Market


                                 Géolocalisation
                   Orientation
                                                   Tourisme


                                 Géolocalisation
         Travail                                               Voisinage


                                  Google Maps
                                                      Voyage
                       Achats
                                    Covoiturage
Points d’accès d’Android

   Point de vue constructeur    Point de vue utilisateur

                                 Système fonctionnel,
     Système Linux + Java
                                    intuitif, évolutif



    Point de vue bidouilleur   Point de vue développeur
                               Application développées
      Projet Open Source
                                   en syntaxe Java
           C++ / Java
                                 SDK complet fourni
Architecture

                                         APPLICATIONS
      Home              Contacts            Phone               Browser                …

                                 APPLICATION FRAMEWORK
    Activity Manager       Window Manager         Content Providers            View System

     Package            Telephony          Resource             Location          Notification
     Manager             Manager           Manager              Manager            Manager

                          JNI                                      ANDROID RUNTIME
                       LIBRARIES
                                                                      Core Libraries
   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
Noyau d’Android



   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
Adaptation aux besoins du mobile

  • 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
Librairies




                     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
Surface Manager


   Application 1




                   Surface Flinger

   Application 2

                                        Écran
                                     (Frame Buffer)
Audio Manager




  Sonnerie d’appel                   Oreillette


                     Audio Flinger


    Lecteur MP3                      Écouteurs
Machine Virtuelle Dalvik




                                                              ANDROID RUNTIME
                     LIBRARIES
                                                                 Core Libraries
   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
Machine Virtuelle Dalvik



       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
Framework & fondations des applications



                                 APPLICATION FRAMEWORK
    Activity Manager       Window Manager         Content Providers            View System

     Package            Telephony          Resource             Location          Notification
     Manager             Manager           Manager              Manager            Manager

                          JNI                                      ANDROID RUNTIME
                       LIBRARIES
                                                                      Core Libraries
   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
Intents


  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)
Intents



                                      Intent
                                     Resolver

                                   Intent 1 App.A
                                   Intent 2 App.B     Publication
                               Edit ContactContacts
                                                       IntentFilter
                                           .
                              View Contact Contacts
                                                          VIEW
                                         .
                                                           EDIT
StartActivity(View Contact)

              2                                                 1
                                     Echange
                                        3

           Messagerie                                      Contacts
Intent Filter


  Objectif : Description du handler

  Publication d’IntentFilters par les activités

  IntentFilter décrivent les capacités de l’application.

<intent-filter>
  <action android:value=quot;android.intent.action.VIEWquot; />
  <action android:value=quot;android.intent.action.EDITquot; />
  <action android:value=quot;android.intent.action.PICKquot; />
  <category android:value=quot;android.intent.category.DEFAULTquot; />
  <type
   android:value=quot;vnd.android.cursor.dir/vnd.google.contactquot; />
</intent-filter>
Les URIs - Utilisation

     Intent               Exemples d’URI:
                   content: //contacts/ people/ 125
   EDIT_ACTION
                                              Ouvre l’application de géo-localisation à
                   geo:      25,32
   VIEW_ACTION
                                              la position donnée (latitude, longitude).
                   tel:       123                    Appelle le numéro 123
   CALL_ACTION

                  google.streetview: cbll=25,32 &cbp=1,yaw,,pitch,zoom
   VIEW_ACTION


           void startActivity(Intent intent) ;
           void sendBroadcast(Intent intent)
           boolean bindService(Intent service, int flags)
           ComponentName startService(Intent service)
Notification Manager

Applications peuvent s’exécuter simultanément

                      Barre de notifications
Notifications d’é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)
Composants d’une application




                               Broadcast
             Activity           Receiver



                               Content
              Service
                               Provider
Content Provider

                                               SYSTEM                       APK
            APK
  service         Activity                                                    service
                                    Activity            Activity




                             Data
                                                        XML
                                          SQLite
                                                                   Remote
                                                                    data
Content Provider

                                                                            APK
            APK                                SYSTEM
  service         Activity                                                    service
                                    Activity            Activity




                                        ContentProvider




                             Data
                                                        XML
                                          SQLite
                                                                   Remote
                                                                    data
Les URIs
                                                                                                Intent
                                                                                    Activity
                                                                                               Receiver

                                                                                               Content
    Exemples d’URI d’un content provider:                                           Service
                                                                                               Provider


             content: //contacts/ people/ 125

             content: //com.maCompanie.monApp/ users/ 53

      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)




 <provider class=quot;.NotePadProviderquot;android:authorities=quot;com.google.provider.NotePadquot; />
Content Provider
                                                                       Intent
                                                           Activity
                                                                      Receiver
              content: //contacts/ people/ 125
      URI :
                                                                      Content
                                                           Service
                                                                      Provider


     Applications                                   Content Providers
                               URI
                                                        Browser
       Annuaire

                                                         Settings
                                 ContentResolver
                                 + delete()
                    Résultat
                                 + insert()             Contacts
                                 + notifyChange()
     Lecteur MP3                 + query()
                                                    MediaStore.Images
                                 + update()

                                                    MediaStore.Audio
Activity
                                                                                      Intent
           Objet qui possède un cycle de vie                              Activity
                                                                                     Receiver

                                                                                     Content
                                                                          Service
                                                                                     Provider
           Code qui réalise un traitement

           Point d’entrée d’une application

           Généralement, une Activity affiche une UI

    <activity class=quot;.NoteEditorquot; android:label=quot;@string/title_notequot;>
             <intent-filter android:label=quot;@string/resolve_editquot;>
                <action android:value=quot;android.intent.action.VIEWquot; />
                <action android:value=quot;android.intent.action.EDITquot; />
                <category android:value=quot;android.intent.category.DEFAULTquot; />
                <type android:value=quot;vnd.android.cursor.item/vnd.google.notequot; />
             </intent-filter>
    </activity>
Broadcast receiver
                                                                          Broadcast
                                                               Activity
                                                                          Receiver
        Broadcast receiver permet de réagir à des                         Content
                                                               Service
        évènements extérieurs à l’application                             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).



    <receiver android:name=quot;.app.OneShotAlarmquot; android:process=quot;:remotequot; />
Service
                                                            Intent
                                                Activity
                                                           Receiver

                                                           Content
                                                Service
                                                           Provider


  Composante sans GUI
  Activité de longue durée

  Service interne : Context.startService()
  Service externe : Context.bindService()


  Communication via une interface
  Ex Media Player : pause, lecture, stop, etc
Service : AndroidManifest
                                                                                Intent
                                                                    Activity
                                                                               Receiver

                                                                               Content
                                                                    Service
                                                                               Provider



 <service android:name=quot;.app.RemoteServicequot; android:process=quot;:remotequot;>
   <intent-filter>
      <!-- These are the interfaces supported by the service, which
          you can bind to. -->
      <action android:name=quot;com.example.android.apis.app.IRemoteServicequot; />
      <!-- This is an action code you can use to select the service
          without explicitly supplying the implementation class. -->
      <action android:name=quot;com.example.android.apis.app.REMOTE_SERVICEquot; />
   </intent-filter>
 </service>
AndroidManifest complet
<manifest xmlns:android=quot;http://schemas.android.com/apk/res/androidquot;
   package=quot;com.android.notepadquot;>
  <application android:icon=quot;@drawable/app_notesquot; android:label=quot;@string/app_namequot;>
    <activity class=quot;.NotesListquot; android:label=quot;@string/title_notes_listquot;>
          <intent-filter>
                                                                                             Activity
             <action android:value=quot;android.intent.action.MAINquot; />
             <category android:value=quot;android.intent.category.LAUNCHERquot; />
          </intent-filter>
    </activity>
                                                                                                Content
    <provider class=quot;.NotePadProviderquot; android:authorities=quot;com.google.provider.NotePadquot;/>      Provider

    <service android:name=quot;.app.RemoteServicequot; android:process=quot;:remotequot;>
          <intent-filter>
             <action android:name=quot;com.example.android.apis.app.IRemoteServicequot; />              Service
          </intent-filter>
    </service>
                                                                                                 Intent
    <receiver android:name=quot;.app.OneShotAlarmquot; android:process=quot;:remotequot; />                     Receiver


  </application>
</manifest>
Cycle de vie d’une Activité

               Intent
   Activity
                                                 Allocation des ressources
              Receiver
                                   OnCreate()
              Content
   Service
              Provider

                                                 Affichage à l’écran
                                    OnStart()


                                                 Passage au premier plan
                                   OnResume()
                         Running
                                                 Passage en arrière plan
                                   OnPause()
                         Paused
                                                 Arrêt de l’exécution
                                    OnStop()
                         Stopped
                                   OnDestroy()   Libération des ressources
                          Killed
Cycle de vie d’une Activité
                                                               Retour à
                                    New Activity            l’application
                 1. OnCreate()
                 2. OnStart()
                 3. OnResume()
                                                                   Application
                                      Running
                                                                     Killed
                                    (Foreground)
                                                     OnFreeze()
                   OnResume()
                                                     OnPause()
3. OnResume()                                                                    Besoin de
                                       Paused
2. OnStart()                                                                     mémoire
                                    (Background)
1. OnRestart()
                     Application
                                                     OnStop()
                     plus visible
                                      Stopped
                                    (Plus visible)
                    L’utilisateur
                                                     OnDestroy()
                       quitte

                                     Destroyed
Hiérarchie des processus

 Hiérarchie des processus

               Foreground Process   Activité


                 Visible Process    Activité en arrière plan
  Importance




                                    Processus des composants
                 Service Process    « Service » disponibles en arrière plan

               Background Process   Processus en arrière plan, non visible.


                 Empty Process      Cache pour les processus
Les applications

                                         APPLICATIONS
      Home              Contacts            Phone               Browser                …

                                 APPLICATION FRAMEWORK
    Activity Manager       Window Manager         Content Providers            View System

     Package            Telephony          Resource             Location          Notification
     Manager             Manager           Manager              Manager            Manager

                          JNI                                      ANDROID RUNTIME
                       LIBRARIES
                                                                      Core Libraries
   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
Développement en Java : Méthode classique


 package com.android.hello;            HelloAndroid.java
 import android.app.Activity;
 import android.os.Bundle;
                                                            JAVA
 import android.widget.TextView;

                                                           (uniquement)
 public class HelloAndroid extends Activity {
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         TextView tv = new TextView(this);
                                                           1 champ de texte
         tv.setText(quot;Hello, Androidquot;);
         setContentView(tv);
     }
 }
Séparation Présentation / Métier

 package com.android.hello;              HelloAndroid.java

                                                             JAVA
 import android.app.Activity;
 import android.os.Bundle;
 import android.widget.TextView;
                                                               métier
 public class HelloAndroid extends Activity {
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
     }
 }


                                                                 XML
 <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
 <TextView
 xmlns:android=quot;http://schemas.android.com/apk/res/androidquot;
                                                                  vues
   android:layout_width=quot;fill_parentquot;
   android:layout_height=quot;fill_parentquot;
   android:text=quot;@string/helloquot;/>                   main.xml
Interfaçage des ressources

                                                              Génération
                                                             automatique

   Description du layout     package com.android.hello;                    R.java
                             public final class R {
                icon.png
   Image                         public static final class attr {
                                 }
                                 public static final class drawable {
                                     public static final int icon=0x7f020000;
                                 }
 Description    main.xml         public static final class layout {
  du layout                          public static final int main=0x7f030000;
                                 }
                                 public static final class string {
                                     public static final int app_name=0x7f040001;
 Étiquettes    strings.xml           public static final int hello=0x7f040000;
    Texte                        }
                             }
Compilation et Déploiement d’une Application


                                  Byte-code
 Sources
                                  (optimisé)

                                    .dex
     .java               .class


                                                  .apk
                                                             /data/app/
       Ressources + Manifest
                                               Application
                  .png                          compilée
                  .xml
HelloWorld
Vidéos StreetView + Compass
?
Vidéos StreetView + Compass
Vidéo StreetView + Compass
Vidéo StreetView + Compass
Booter Android

Weitere ähnliche Inhalte

Was ist angesagt?

Ch2. Développement mobile
Ch2. Développement mobileCh2. Développement mobile
Ch2. Développement mobileHaifa Chorfi
 
Developpement mobile vs open source
Developpement mobile vs open sourceDeveloppement mobile vs open source
Developpement mobile vs open sourceKorteby Farouk
 
Chapitre 1-introduction-plateforme-android
Chapitre 1-introduction-plateforme-androidChapitre 1-introduction-plateforme-android
Chapitre 1-introduction-plateforme-androidSalah Gharbi
 
Plateformes de développement d’applications mobiles
Plateformes de développement d’applications mobilesPlateformes de développement d’applications mobiles
Plateformes de développement d’applications mobilesEric Toguem
 
Présentation et Initiative pour le développement Android
Présentation et Initiative pour le développement AndroidPrésentation et Initiative pour le développement Android
Présentation et Initiative pour le développement Androidyounes ben tlili
 
Windows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer TalksWindows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer TalksJean-Sébastien Dupuy
 
Formation Android (Initiation à la programmation sous Android)
Formation Android (Initiation à la programmation sous Android)Formation Android (Initiation à la programmation sous Android)
Formation Android (Initiation à la programmation sous Android)G²FOSS ENIT
 
1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - Alloy
1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - Alloy1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - Alloy
1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - AlloyMeetup Mobile Montpellier
 
Présentation de la plateforme Android
Présentation de la plateforme AndroidPrésentation de la plateforme Android
Présentation de la plateforme AndroidMohamed BOURAOUI
 
Cours android
Cours androidCours android
Cours androidAd Hafsa
 
SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...
SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...
SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...TelecomValley
 
Développement d'applications mobiles.. Environnement de programmation visuelle
Développement d'applications mobiles.. Environnement de programmation visuelleDéveloppement d'applications mobiles.. Environnement de programmation visuelle
Développement d'applications mobiles.. Environnement de programmation visuelleREGIONAL ACADEMY OF EDUCATION AND TRAINING
 
Choisir sa plateforme de développement mobile
Choisir sa plateforme de développement mobileChoisir sa plateforme de développement mobile
Choisir sa plateforme de développement mobileSQLI DIGITAL EXPERIENCE
 
Les Systèmes d'exploitation mobile
Les Systèmes d'exploitation mobileLes Systèmes d'exploitation mobile
Les Systèmes d'exploitation mobileMohamed BOURAOUI
 
CocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLab
CocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLabCocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLab
CocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLabCocoaHeads France
 
Tech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobilesTech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobilesMichael Laguerre
 
Développement Cross-Platform avec Titanium Mobile
Développement Cross-Platform avec Titanium MobileDéveloppement Cross-Platform avec Titanium Mobile
Développement Cross-Platform avec Titanium MobileXavier Lacot
 
Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...
Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...
Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...Jonathan De Roy
 

Was ist angesagt? (20)

Ch2. Développement mobile
Ch2. Développement mobileCh2. Développement mobile
Ch2. Développement mobile
 
Intro Android
Intro AndroidIntro Android
Intro Android
 
Developpement mobile vs open source
Developpement mobile vs open sourceDeveloppement mobile vs open source
Developpement mobile vs open source
 
Chapitre 1-introduction-plateforme-android
Chapitre 1-introduction-plateforme-androidChapitre 1-introduction-plateforme-android
Chapitre 1-introduction-plateforme-android
 
Plateformes de développement d’applications mobiles
Plateformes de développement d’applications mobilesPlateformes de développement d’applications mobiles
Plateformes de développement d’applications mobiles
 
Présentation et Initiative pour le développement Android
Présentation et Initiative pour le développement AndroidPrésentation et Initiative pour le développement Android
Présentation et Initiative pour le développement Android
 
Windows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer TalksWindows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer Talks
 
Formation Android (Initiation à la programmation sous Android)
Formation Android (Initiation à la programmation sous Android)Formation Android (Initiation à la programmation sous Android)
Formation Android (Initiation à la programmation sous Android)
 
1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - Alloy
1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - Alloy1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - Alloy
1er Meetup Mobile Montpellier - Présentation Appcelerator Titanium - Alloy
 
Présentation de la plateforme Android
Présentation de la plateforme AndroidPrésentation de la plateforme Android
Présentation de la plateforme Android
 
Cours android
Cours androidCours android
Cours android
 
SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...
SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...
SophiaConf 2010 Présentation de la conférence du 05 Juillet - Android :Tout s...
 
Développement d'applications mobiles.. Environnement de programmation visuelle
Développement d'applications mobiles.. Environnement de programmation visuelleDéveloppement d'applications mobiles.. Environnement de programmation visuelle
Développement d'applications mobiles.. Environnement de programmation visuelle
 
Choisir sa plateforme de développement mobile
Choisir sa plateforme de développement mobileChoisir sa plateforme de développement mobile
Choisir sa plateforme de développement mobile
 
Android
AndroidAndroid
Android
 
Les Systèmes d'exploitation mobile
Les Systèmes d'exploitation mobileLes Systèmes d'exploitation mobile
Les Systèmes d'exploitation mobile
 
CocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLab
CocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLabCocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLab
CocoaHeads Toulouse - Présentation Windows Phone 7 - ClevLab
 
Tech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobilesTech Conf n°1 - Développement natif d'applications mobiles
Tech Conf n°1 - Développement natif d'applications mobiles
 
Développement Cross-Platform avec Titanium Mobile
Développement Cross-Platform avec Titanium MobileDéveloppement Cross-Platform avec Titanium Mobile
Développement Cross-Platform avec Titanium Mobile
 
Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...
Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...
Quel type de système d'exploitation mobile est-il préférable d'utiliser du po...
 

Andere mochten auch

Presentation Projet Web
Presentation Projet WebPresentation Projet Web
Presentation Projet Webguest660a58
 
Pictures of the Future Siemens Printemps 2012
Pictures of the Future Siemens Printemps 2012Pictures of the Future Siemens Printemps 2012
Pictures of the Future Siemens Printemps 2012SiemensFrance
 
Livre LabVIEW 2015 : Programme et Applications
Livre LabVIEW 2015 : Programme et ApplicationsLivre LabVIEW 2015 : Programme et Applications
Livre LabVIEW 2015 : Programme et ApplicationsLuc Desruelle
 
Livre LabVIEW : Programmation et applications
Livre LabVIEW : Programmation et applicationsLivre LabVIEW : Programmation et applications
Livre LabVIEW : Programmation et applicationsLuc Desruelle
 
Getting started with LabVIEW
Getting started with LabVIEWGetting started with LabVIEW
Getting started with LabVIEWYomna Eid
 
Wincc plant-intelligence
Wincc plant-intelligenceWincc plant-intelligence
Wincc plant-intelligenceAbdoul Karim
 
Certificate of completion
Certificate of completion Certificate of completion
Certificate of completion Bilal Jamjama
 
SCADA Labview PLC TIA portal v13
SCADA Labview PLC TIA portal v13SCADA Labview PLC TIA portal v13
SCADA Labview PLC TIA portal v13Mohsen Sadok
 
Colaimo 140330083749-phpapp01
Colaimo 140330083749-phpapp01Colaimo 140330083749-phpapp01
Colaimo 140330083749-phpapp01Mss Med
 
Plantilla Fase 1: Arquitectura de un Computador
Plantilla Fase 1: Arquitectura de un ComputadorPlantilla Fase 1: Arquitectura de un Computador
Plantilla Fase 1: Arquitectura de un ComputadorAngélica María
 
Rapport de projet de fin d'études - SIEMENS 2016
Rapport de projet de fin d'études - SIEMENS 2016Rapport de projet de fin d'études - SIEMENS 2016
Rapport de projet de fin d'études - SIEMENS 2016Soufiane KALLIDA
 
Exemple de CV professionnel
Exemple de CV professionnelExemple de CV professionnel
Exemple de CV professionnelRAMZI EL IDRISSI
 
Derechos inspección sorpresa astic
Derechos inspección sorpresa asticDerechos inspección sorpresa astic
Derechos inspección sorpresa asticCIALT
 
Comercio electronico introduccion UJMD
Comercio electronico introduccion UJMDComercio electronico introduccion UJMD
Comercio electronico introduccion UJMDHector Maida
 
Ma présentation PFE : Application Android & Site Web
Ma présentation PFE : Application Android & Site WebMa présentation PFE : Application Android & Site Web
Ma présentation PFE : Application Android & Site WebHarrathi Mohamed
 
Soyut s an
Soyut s anSoyut s an
Soyut s anhafize
 

Andere mochten auch (20)

Presentation Projet Web
Presentation Projet WebPresentation Projet Web
Presentation Projet Web
 
Pictures of the Future Siemens Printemps 2012
Pictures of the Future Siemens Printemps 2012Pictures of the Future Siemens Printemps 2012
Pictures of the Future Siemens Printemps 2012
 
Livre LabVIEW 2015 : Programme et Applications
Livre LabVIEW 2015 : Programme et ApplicationsLivre LabVIEW 2015 : Programme et Applications
Livre LabVIEW 2015 : Programme et Applications
 
Livre LabVIEW : Programmation et applications
Livre LabVIEW : Programmation et applicationsLivre LabVIEW : Programmation et applications
Livre LabVIEW : Programmation et applications
 
Getting started with LabVIEW
Getting started with LabVIEWGetting started with LabVIEW
Getting started with LabVIEW
 
Wincc plant-intelligence
Wincc plant-intelligenceWincc plant-intelligence
Wincc plant-intelligence
 
Certificate of completion
Certificate of completion Certificate of completion
Certificate of completion
 
SCADA Labview PLC TIA portal v13
SCADA Labview PLC TIA portal v13SCADA Labview PLC TIA portal v13
SCADA Labview PLC TIA portal v13
 
Rapport cimat
Rapport cimatRapport cimat
Rapport cimat
 
Colaimo 140330083749-phpapp01
Colaimo 140330083749-phpapp01Colaimo 140330083749-phpapp01
Colaimo 140330083749-phpapp01
 
Plantilla Fase 1: Arquitectura de un Computador
Plantilla Fase 1: Arquitectura de un ComputadorPlantilla Fase 1: Arquitectura de un Computador
Plantilla Fase 1: Arquitectura de un Computador
 
Rapport de projet de fin d'études - SIEMENS 2016
Rapport de projet de fin d'études - SIEMENS 2016Rapport de projet de fin d'études - SIEMENS 2016
Rapport de projet de fin d'études - SIEMENS 2016
 
Exemple de CV professionnel
Exemple de CV professionnelExemple de CV professionnel
Exemple de CV professionnel
 
Decodage d'adresse
Decodage d'adresseDecodage d'adresse
Decodage d'adresse
 
Apostila de direito internacional
Apostila de direito internacionalApostila de direito internacional
Apostila de direito internacional
 
Derechos inspección sorpresa astic
Derechos inspección sorpresa asticDerechos inspección sorpresa astic
Derechos inspección sorpresa astic
 
Hoja de vida
Hoja de vida Hoja de vida
Hoja de vida
 
Comercio electronico introduccion UJMD
Comercio electronico introduccion UJMDComercio electronico introduccion UJMD
Comercio electronico introduccion UJMD
 
Ma présentation PFE : Application Android & Site Web
Ma présentation PFE : Application Android & Site WebMa présentation PFE : Application Android & Site Web
Ma présentation PFE : Application Android & Site Web
 
Soyut s an
Soyut s anSoyut s an
Soyut s an
 

Ähnlich wie Presentation Android

Win phone 7 (metoui nadia habibi malek et ben ayad maher)
Win phone 7 (metoui nadia  habibi malek et ben ayad maher)Win phone 7 (metoui nadia  habibi malek et ben ayad maher)
Win phone 7 (metoui nadia habibi malek et ben ayad maher)nadischka66
 
Les secrets du développement d'une application mobile
Les secrets du développement d'une application mobileLes secrets du développement d'une application mobile
Les secrets du développement d'une application mobileEutech SSII
 
Developper une application mobile
Developper une application mobileDevelopper une application mobile
Developper une application mobileEutech SSII
 
Applications mobiles et outils technologiques au chantier : passez de dinosau...
Applications mobiles et outils technologiques au chantier : passez de dinosau...Applications mobiles et outils technologiques au chantier : passez de dinosau...
Applications mobiles et outils technologiques au chantier : passez de dinosau...Frédéric Perron
 
Introduction à Samsung bada
Introduction à Samsung badaIntroduction à Samsung bada
Introduction à Samsung badaBeMyApp
 
Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8
Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8
Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8Microsoft
 
Présentation développement application Android
Présentation développement application AndroidPrésentation développement application Android
Présentation développement application Androidambin_fr
 
APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...
APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...
APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...Microsoft
 
Gtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogyGtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogySacha Leprêtre
 
[Webinar Niji] Frameworks XPlateform mobile - 2210
[Webinar Niji] Frameworks XPlateform mobile - 2210 [Webinar Niji] Frameworks XPlateform mobile - 2210
[Webinar Niji] Frameworks XPlateform mobile - 2210 Niji
 
Présentation écosystème mobile
Présentation écosystème mobilePrésentation écosystème mobile
Présentation écosystème mobileguest28b3ded
 
chapitre-1-introduction-plateforme-android (2).pdf
chapitre-1-introduction-plateforme-android (2).pdfchapitre-1-introduction-plateforme-android (2).pdf
chapitre-1-introduction-plateforme-android (2).pdfolfaharrabi2
 
Tech conf1 développement_natif_applications_mobiles
Tech conf1 développement_natif_applications_mobilesTech conf1 développement_natif_applications_mobiles
Tech conf1 développement_natif_applications_mobilesTelecomValley
 
Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...
Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...
Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...Microsoft
 

Ähnlich wie Presentation Android (20)

Win phone 7 (metoui nadia habibi malek et ben ayad maher)
Win phone 7 (metoui nadia  habibi malek et ben ayad maher)Win phone 7 (metoui nadia  habibi malek et ben ayad maher)
Win phone 7 (metoui nadia habibi malek et ben ayad maher)
 
Les secrets du développement d'une application mobile
Les secrets du développement d'une application mobileLes secrets du développement d'une application mobile
Les secrets du développement d'une application mobile
 
Developper une application mobile
Developper une application mobileDevelopper une application mobile
Developper une application mobile
 
Applications mobiles et outils technologiques au chantier : passez de dinosau...
Applications mobiles et outils technologiques au chantier : passez de dinosau...Applications mobiles et outils technologiques au chantier : passez de dinosau...
Applications mobiles et outils technologiques au chantier : passez de dinosau...
 
Windows phone 7
Windows phone 7Windows phone 7
Windows phone 7
 
Introduction à Samsung bada
Introduction à Samsung badaIntroduction à Samsung bada
Introduction à Samsung bada
 
Programmation sous Android
Programmation sous AndroidProgrammation sous Android
Programmation sous Android
 
Dcf 2018-v2
Dcf 2018-v2Dcf 2018-v2
Dcf 2018-v2
 
Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8
Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8
Créer des applications métier (LOB) pour Windows 8 et Windows Phone 8
 
Présentation développement application Android
Présentation développement application AndroidPrésentation développement application Android
Présentation développement application Android
 
APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...
APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...
APIs Facebook, Twitter, Foursquare… tirer parti des réseaux sociaux dans votr...
 
Présentation Conférence des TechTrends
Présentation Conférence des TechTrendsPrésentation Conférence des TechTrends
Présentation Conférence des TechTrends
 
Gtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogyGtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogy
 
Cv fr-gharsallah yassine
Cv fr-gharsallah yassineCv fr-gharsallah yassine
Cv fr-gharsallah yassine
 
[Webinar Niji] Frameworks XPlateform mobile - 2210
[Webinar Niji] Frameworks XPlateform mobile - 2210 [Webinar Niji] Frameworks XPlateform mobile - 2210
[Webinar Niji] Frameworks XPlateform mobile - 2210
 
Présentation écosystème mobile
Présentation écosystème mobilePrésentation écosystème mobile
Présentation écosystème mobile
 
chapitre-1-introduction-plateforme-android (2).pdf
chapitre-1-introduction-plateforme-android (2).pdfchapitre-1-introduction-plateforme-android (2).pdf
chapitre-1-introduction-plateforme-android (2).pdf
 
Les applications mobiles
Les applications mobilesLes applications mobiles
Les applications mobiles
 
Tech conf1 développement_natif_applications_mobiles
Tech conf1 développement_natif_applications_mobilesTech conf1 développement_natif_applications_mobiles
Tech conf1 développement_natif_applications_mobiles
 
Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...
Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...
Applications métiers et/ou d'entreprise sur Windows Phone 7 - bonnes pratique...
 

Presentation Android

  • 1. Introduction à Android by Jean Collas, Ghislain Deffrasne, Reda Sebbani is 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 Téléphonie Mobile : Smart Phone Développement logiciel pour mobiles Chiffre d’affaire énorme Windows RIM Mobile 40 millions de smartphones / trimestre (2008) Symbian iPhone OS
  • 4. Contexte Concurrentiel Systèmes d’exploitation pour Smart phone : 70% 60% 50% 40% 30% 20% 10% 0% 2007 2008 Marché en constante augmentation (+28% en 1 an, 31M -> 40M) Possibilités d’évolution énormes avec un bon produit
  • 5. Internet & Google 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
  • 6. Points forts d’Android Points fort d’Android Point de vue constructeur Point de vue utilisateur Système fonctionnel, Système Linux + Java intuitif, évolutif Point de vue bidouilleur Point de vue développeur Application développées Projet Open Source en syntaxe Java C++ / Java SDK complet fourni
  • 7. Historique Novembre 2008 Android 1.0 et SDK release 2 T-Mobile G1 Octobre 2008 Android : Open Source Android 1.0 et SDK release 1 Septembre 2008 Android Market Août 2008 Avril 2008 Developer Challenge Open Handset Alliance Novembre 2007 Annonce d’Android SDK pour Android Développement d’Android Start-up Android Août 2005
  • 8. Open Handset Alliance  Consortium créé fin 2007  47 compagnies Fabricants de semi-conducteurs Opérateurs de téléphonie mobile Fabricants d'appareils mobiles Entreprises de commercialisation Fabricants de logiciels  But : développer des normes ouvertes pour les appareils de téléphonie mobile
  • 9. T-Mobile G1 T-Mobile G1 (HTC)  1er téléphone avec Android  De 180 à 400 $  Wi-fi et Bluetooth  GPS  Accéléromètres  Caméra  Écran tactile
  • 10. De nouveaux mobiles LG L’agora par Kogan
  • 11. Preuve de sa portabilité – Futur d’Android Et si Android n’était pas seulement conçu pour les smartphone? Android sur un NetBook
  • 12. Intégration des applications Google Barre de recherche « Google Search » Gmail Google Talk (IM) Navigateur Web Gmaps Google StreetView
  • 13. Exemples d’applications : Android Market Géolocalisation Orientation Tourisme Géolocalisation Travail Voisinage Google Maps Voyage Achats Covoiturage
  • 14. Points d’accès d’Android Point de vue constructeur Point de vue utilisateur Système fonctionnel, Système Linux + Java intuitif, évolutif Point de vue bidouilleur Point de vue développeur Application développées Projet Open Source en syntaxe Java C++ / Java SDK complet fourni
  • 15. Architecture APPLICATIONS Home Contacts Phone Browser … APPLICATION FRAMEWORK Activity Manager Window Manager Content Providers View System Package Telephony Resource Location Notification Manager Manager Manager Manager Manager JNI ANDROID RUNTIME LIBRARIES Core Libraries 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
  • 16. Noyau d’Android 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
  • 17. Adaptation aux besoins du mobile • 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
  • 18. Librairies 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
  • 19. Surface Manager Application 1 Surface Flinger Application 2 Écran (Frame Buffer)
  • 20. Audio Manager Sonnerie d’appel Oreillette Audio Flinger Lecteur MP3 Écouteurs
  • 21. Machine Virtuelle Dalvik ANDROID RUNTIME LIBRARIES Core Libraries 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
  • 22. Machine Virtuelle Dalvik 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
  • 23. Framework & fondations des applications APPLICATION FRAMEWORK Activity Manager Window Manager Content Providers View System Package Telephony Resource Location Notification Manager Manager Manager Manager Manager JNI ANDROID RUNTIME LIBRARIES Core Libraries 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
  • 24. Intents 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)
  • 25. Intents Intent Resolver Intent 1 App.A Intent 2 App.B Publication Edit ContactContacts IntentFilter . View Contact Contacts VIEW . EDIT StartActivity(View Contact) 2 1 Echange 3 Messagerie Contacts
  • 26. Intent Filter Objectif : Description du handler Publication d’IntentFilters par les activités IntentFilter décrivent les capacités de l’application. <intent-filter> <action android:value=quot;android.intent.action.VIEWquot; /> <action android:value=quot;android.intent.action.EDITquot; /> <action android:value=quot;android.intent.action.PICKquot; /> <category android:value=quot;android.intent.category.DEFAULTquot; /> <type android:value=quot;vnd.android.cursor.dir/vnd.google.contactquot; /> </intent-filter>
  • 27. Les URIs - Utilisation Intent Exemples d’URI: content: //contacts/ people/ 125 EDIT_ACTION Ouvre l’application de géo-localisation à geo: 25,32 VIEW_ACTION la position donnée (latitude, longitude). tel: 123 Appelle le numéro 123 CALL_ACTION google.streetview: cbll=25,32 &cbp=1,yaw,,pitch,zoom VIEW_ACTION void startActivity(Intent intent) ; void sendBroadcast(Intent intent) boolean bindService(Intent service, int flags) ComponentName startService(Intent service)
  • 28. Notification Manager Applications peuvent s’exécuter simultanément Barre de notifications Notifications d’é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)
  • 29. Composants d’une application Broadcast Activity Receiver Content Service Provider
  • 30. Content Provider SYSTEM APK APK service Activity service Activity Activity Data XML SQLite Remote data
  • 31. Content Provider APK APK SYSTEM service Activity service Activity Activity ContentProvider Data XML SQLite Remote data
  • 32. Les URIs Intent Activity Receiver Content Exemples d’URI d’un content provider: Service Provider content: //contacts/ people/ 125 content: //com.maCompanie.monApp/ users/ 53 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) <provider class=quot;.NotePadProviderquot;android:authorities=quot;com.google.provider.NotePadquot; />
  • 33. Content Provider Intent Activity Receiver content: //contacts/ people/ 125 URI : Content Service Provider Applications Content Providers URI Browser Annuaire Settings ContentResolver + delete() Résultat + insert() Contacts + notifyChange() Lecteur MP3 + query() MediaStore.Images + update() MediaStore.Audio
  • 34. Activity Intent Objet qui possède un cycle de vie Activity Receiver Content Service Provider Code qui réalise un traitement Point d’entrée d’une application Généralement, une Activity affiche une UI <activity class=quot;.NoteEditorquot; android:label=quot;@string/title_notequot;> <intent-filter android:label=quot;@string/resolve_editquot;> <action android:value=quot;android.intent.action.VIEWquot; /> <action android:value=quot;android.intent.action.EDITquot; /> <category android:value=quot;android.intent.category.DEFAULTquot; /> <type android:value=quot;vnd.android.cursor.item/vnd.google.notequot; /> </intent-filter> </activity>
  • 35. Broadcast receiver Broadcast Activity Receiver Broadcast receiver permet de réagir à des Content Service évènements extérieurs à l’application 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). <receiver android:name=quot;.app.OneShotAlarmquot; android:process=quot;:remotequot; />
  • 36. Service Intent Activity Receiver Content Service Provider Composante sans GUI Activité de longue durée Service interne : Context.startService() Service externe : Context.bindService() Communication via une interface Ex Media Player : pause, lecture, stop, etc
  • 37. Service : AndroidManifest Intent Activity Receiver Content Service Provider <service android:name=quot;.app.RemoteServicequot; android:process=quot;:remotequot;> <intent-filter> <!-- These are the interfaces supported by the service, which you can bind to. --> <action android:name=quot;com.example.android.apis.app.IRemoteServicequot; /> <!-- This is an action code you can use to select the service without explicitly supplying the implementation class. --> <action android:name=quot;com.example.android.apis.app.REMOTE_SERVICEquot; /> </intent-filter> </service>
  • 38. AndroidManifest complet <manifest xmlns:android=quot;http://schemas.android.com/apk/res/androidquot; package=quot;com.android.notepadquot;> <application android:icon=quot;@drawable/app_notesquot; android:label=quot;@string/app_namequot;> <activity class=quot;.NotesListquot; android:label=quot;@string/title_notes_listquot;> <intent-filter> Activity <action android:value=quot;android.intent.action.MAINquot; /> <category android:value=quot;android.intent.category.LAUNCHERquot; /> </intent-filter> </activity> Content <provider class=quot;.NotePadProviderquot; android:authorities=quot;com.google.provider.NotePadquot;/> Provider <service android:name=quot;.app.RemoteServicequot; android:process=quot;:remotequot;> <intent-filter> <action android:name=quot;com.example.android.apis.app.IRemoteServicequot; /> Service </intent-filter> </service> Intent <receiver android:name=quot;.app.OneShotAlarmquot; android:process=quot;:remotequot; /> Receiver </application> </manifest>
  • 39. Cycle de vie d’une Activité Intent Activity Allocation des ressources Receiver OnCreate() Content Service Provider Affichage à l’écran OnStart() Passage au premier plan OnResume() Running Passage en arrière plan OnPause() Paused Arrêt de l’exécution OnStop() Stopped OnDestroy() Libération des ressources Killed
  • 40. Cycle de vie d’une Activité Retour à New Activity l’application 1. OnCreate() 2. OnStart() 3. OnResume() Application Running Killed (Foreground) OnFreeze() OnResume() OnPause() 3. OnResume() Besoin de Paused 2. OnStart() mémoire (Background) 1. OnRestart() Application OnStop() plus visible Stopped (Plus visible) L’utilisateur OnDestroy() quitte Destroyed
  • 41. Hiérarchie des processus Hiérarchie des processus Foreground Process Activité Visible Process Activité en arrière plan Importance Processus des composants Service Process « Service » disponibles en arrière plan Background Process Processus en arrière plan, non visible. Empty Process Cache pour les processus
  • 42. Les applications APPLICATIONS Home Contacts Phone Browser … APPLICATION FRAMEWORK Activity Manager Window Manager Content Providers View System Package Telephony Resource Location Notification Manager Manager Manager Manager Manager JNI ANDROID RUNTIME LIBRARIES Core Libraries 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
  • 43. Développement en Java : Méthode classique package com.android.hello; HelloAndroid.java import android.app.Activity; import android.os.Bundle; JAVA import android.widget.TextView; (uniquement) public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); 1 champ de texte tv.setText(quot;Hello, Androidquot;); setContentView(tv); } }
  • 44. Séparation Présentation / Métier package com.android.hello; HelloAndroid.java JAVA import android.app.Activity; import android.os.Bundle; import android.widget.TextView; métier public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } XML <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <TextView xmlns:android=quot;http://schemas.android.com/apk/res/androidquot; vues android:layout_width=quot;fill_parentquot; android:layout_height=quot;fill_parentquot; android:text=quot;@string/helloquot;/> main.xml
  • 45. Interfaçage des ressources Génération automatique Description du layout package com.android.hello; R.java public final class R { icon.png Image public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; } Description main.xml public static final class layout { du layout public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040001; Étiquettes strings.xml public static final int hello=0x7f040000; Texte } }
  • 46. Compilation et Déploiement d’une Application Byte-code Sources (optimisé) .dex .java .class .apk /data/app/ Ressources + Manifest Application .png compilée .xml
  • 50.