tech conf n°1 - développement natif d'applications mobiles
DESCRIPTION
Conférence sur le développement d'applications mobiles natives sur plateformes mobiles iOS et Android. En collaboration avec Nicolas GOUTALAND de TeachOnMars pour la partie iOS. Tech Conf n°1 organisée par la Telecom Valley, 4 juin 2014 au Campus SophiaTechTRANSCRIPT
![Page 1: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/1.jpg)
1
Développement natifd’applications mobiles
TechConf #1 - Telecom Valley / 4 juin 2014Nicolas GOUTALAND (Teach on Mars) - Michael LAGUERRE (Ausy)
![Page 2: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/2.jpg)
Question
Sous quel OS tourne votre téléphone ?
2
![Page 3: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/3.jpg)
Une multitude d’OS mobiles
3
![Page 4: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/4.jpg)
Introduction Parts de marché 2Q 2013
4
Autres 4 %
Windows Phone 3 %
Android 79 %
iOS 14 %
Monde
Autres 7 %
Symbian 2 %
Android 41 %
iOS 49 %
France
![Page 5: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/5.jpg)
Introduction
5
Evolution du traficwebsites vs applications
Evolution du traficwebsites
![Page 6: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/6.jpg)
Introduction
6
![Page 7: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/7.jpg)
Développement natif
• Performance
• Meilleure intégration
• Meilleur rendu
• Complexité des applications
7
![Page 8: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/8.jpg)
Qui sommes-nous ?
Nicolas GOUTALAND
• Développement iOS depuis le premier SDK
• Plus d’une centaine d’applications
• CTO @Teach on Mars
8
![Page 9: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/9.jpg)
Qui sommes-nous ?
Michael LAGUERRE
• Développement Android depuis 4 ans
• Une 40aine d’applications sur le PlayStore
• Expert Android @Ausy
• Enseignant @Polytech Nice Sophia et @IUT de Sophia en Android et IHM
9
![Page 10: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/10.jpg)
Par où commencer ?
10
![Page 11: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/11.jpg)
Android developer account
• Android — https://play.google.com/apps/publish
• Un unique type de compte
• Publication sur le PlayStore
• Pas obligatoire pour développer - > publication sur site WEB
• $25 à vie
11
![Page 12: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/12.jpg)
Prérequis
• Mac
• Création d’un Apple ID
• Choix d’une licence
12
![Page 13: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/13.jpg)
iOS Developer Program
• 99$ (~80€) chaque année
• Licence personnelle ou entreprise
• Publication d’applications sur l’AppStore
• 100 devices de test
13
![Page 14: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/14.jpg)
iOS Developer Enterprise Program
• 299$ (~250 €) chaque année
• Distributions d’applications internes à une entreprise (OTA)
• Pas de limites sur la distribution
14
![Page 15: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/15.jpg)
Développer pour Android
15
![Page 16: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/16.jpg)
Eclipse vs Android Studio
• Eclipse • Utilisé depuis les débuts d’Android
• Plugin ADT (Android Development Toolkit)
• Compilation : ANT
!
• Android Studio • Introduit à la Google I/O 2013
• Encore en Developer Preview
• Basé sur la dernière version d’IntelliJ
• Compilation : Gradle
16
![Page 17: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/17.jpg)
Eclipse
17
![Page 18: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/18.jpg)
Android Studio
18
![Page 19: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/19.jpg)
Android SDK
19
ADT
Hierarchy Viewer Emulateur
draw9patch
![Page 20: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/20.jpg)
Android SDK
• Contient :
• ADT / Librairies nécessaires au développement d’applications Android
• Emulateur Android / Création de devices virtuels -AVD- de différentes configurations hard/soft
• Hierarchy Viewer / Visualisation de l’arborescence d’un écran
• draw9patch / Création de ressources graphiques extensibles
20
![Page 21: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/21.jpg)
Emulateur Android
21
![Page 22: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/22.jpg)
Emulateur Android - Genymotion
22
10x plus rapideque l’émulateur Android
![Page 23: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/23.jpg)
HierarchyViewer
23
![Page 24: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/24.jpg)
draw9patch
24
![Page 25: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/25.jpg)
Le langageJAVA/XML
• Langages :
• JAVA pour le code
• XML pour l’interface, les ressources
!
• Création d’un fichier APK
!
• Développement possible sur Windows, MacOS, Linux
!
• IDE : Eclipse, Android Studio
25
.java .xml
.APK
![Page 26: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/26.jpg)
Le langageJAVA/XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"> <TextView android:text="@string/hello_world" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout>
26
package com.example.app; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
XML
JAVA
GUI
Logique
![Page 27: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/27.jpg)
Développer pour iOS
27
![Page 28: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/28.jpg)
Xcode vs AppCode
• Xcode • IDE développé par Apple
• Gratuit
!
• AppCode • IDE développé par JetBRAINS (IntelliJ)
• Version 3.0 disponible depuis le 20 Mai
• Payant
28
![Page 29: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/29.jpg)
Xcode
29
![Page 30: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/30.jpg)
AppCode
30
![Page 31: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/31.jpg)
iOS Tools
31
![Page 32: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/32.jpg)
Interface builder
32
![Page 33: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/33.jpg)
Instruments
33
![Page 34: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/34.jpg)
Reveal
34
![Page 35: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/35.jpg)
• Objective-C
• [ ]
• Preprocesseur C
• Protocol / Category
• ARC
• Pas de NullPointerException ;)
35
Le langageObjective-C
![Page 36: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/36.jpg)
Le langageObjective-C
#pragma mark - View management - (void)viewDidLoad { // Hold ordered labels _labels = @[_knownQuestionsLabel, _unknownQuestionsLabel, _didReachObjectiveLabel]; [_labels each:^(UILabel *label) { [[StyleManager sharedInstance] configureDescriptionText:label]; }]; ! [super viewDidLoad]; ! // Localize _scoreCaptionLabel.font = FONT_FUTURA_STD(25.0); _userScoreLabel.font = FONT_FUTURA_HEAVY(25.0); _scoreCaptionLabel.textColor = NORMAL_TEXT_COLOR; _userScoreLabel.textColor = NORMAL_TEXT_COLOR; ! // Configure title label _titleLabel.text = LOCALIZED_STRING(@"QuizResultViewController.title"); [[StyleManager sharedInstance] configureGradientLabel:_titleLabel]; ! _scoreCaptionLabel.text = LOCALIZED_STRING(@"QuizResultViewController.yourScore.caption"); ! UPDATE_VIEW_FRAME_HEIGHT(_contentView, [ROOT_VIEW_CONTROLLER footerHeight]); }
36
![Page 37: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/37.jpg)
37
L’autre langage Swift
![Page 38: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/38.jpg)
L’autre langage Swift
38
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet var tableView : UITableView var items:Dictionary<String,String>=["Pizza Margherita":"Tomato, mozzarella, oregano ", "Pizza viennese":"German sausage, oregano, oil", "Pizza capricciosa":"mushrooms, artichokes"] func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int { return self.items.count; } func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { var cell:myCell = self.tableView.dequeueReusableCellWithIdentifier("miaCella") as myCell let menusPizza=Array(items.keys) let menusingredients=Array(items.values) ! cell.mioTesto.text = menusPizza[indexPath.row] cell.mioSubtitle.text = menusingredients[indexPath.row]; return cell } func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { performSegueWithIdentifier("miaview", sender: self.view) println("Hai selezionato: \(indexPath.row)!") }}
![Page 39: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/39.jpg)
Une app mobile : un ensemble de composants
39
![Page 40: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/40.jpg)
Une application mobile, c’est :
40
Interface graphique
Data
RéseauCapteurs
Services OS
![Page 41: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/41.jpg)
Google Play Services
• Ensemble d’API Google « extraites » d’Android
• APK installé sur 99.9% des terminaux -> réduction des effets de la fragmentation
• Portage de nouvelles API sur les anciennes versions d’Android
41
• Google Maps API • Geofencing • Fused Location Provider • Reconnaissance d’activité • Google Play Games API • Google+ API • Google Drive API • Google Cast API • Google Mobile Ads • Google Wallet • Google Cloud Messaging • … • … et plein d’autres à venir
![Page 42: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/42.jpg)
Frameworks iOS
• Foundation : Classes de base (Array, Dictionary, String, Network)
• CoreData : ORM
• UIKit : Framework de composants graphiques
• CoreAnimation : Classes en charge des animations
• CoreLocation, CoreMotion : Gestion des capteurs
• et pleins d’autres encore …
42
![Page 43: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/43.jpg)
Ressources et liens utiles
43
![Page 47: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/47.jpg)
Tips AndroidLibrairies utiles
• Retrofit : Appels réseau + transformation en objets http://square.github.io/retrofit/
• Picasso : Téléchargement des images en background http://square.github.io/picasso/
• EventBus : Bus évènementiel de communication entre composants https://github.com/greenrobot/EventBus
• GreenDao : ORM SQLite pour Android http://greendao-orm.com/
• Android Asset Studio : Générateur de ressources Android http://romannurik.github.io/AndroidAssetStudio/
47
![Page 48: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/48.jpg)
Tips AndroidLiens utiles
• http://developer.android.com/
• http://www.vogella.com/tutorials/android.html
48
![Page 49: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/49.jpg)
Tips iOSLibrairies / outils utiles
• Alcatraz : Gestionnaire de plug-ins Xcode http://alcatraz.io
• CocoaPods : Gestionnaire de dépendances http://cocoapods.org/
• AFNetworking : Appels réseau http://afnetworking.com/
• SDWebImage : Téléchargement des images en background https://github.com/rs/SDWebImage
• Reveal : Visualisation 3D éclatée de l’interfacehttp://revealapp.com/
• Crashlytics : Remontée automatique de rapport de crashs https://www.crashlytics.com
49
![Page 50: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/50.jpg)
• www.raywenderlich.com
• www.maniacdev.com
• www.cocoacontrols.com
• https://developer.apple.com
50
Tips iOSLiens utiles
![Page 51: Tech Conf n°1 - Développement natif d'applications mobiles](https://reader035.vdocuments.net/reader035/viewer/2022081401/558c7d02d8b42a8c4c8b46bf/html5/thumbnails/51.jpg)
Merci de votre attentionDes questions ?
51
?