Tech conf1 développement_natif_applications_mobiles
-
Upload
telecomvalley -
Category
Data & Analytics
-
view
85 -
download
1
Transcript of Tech conf1 développement_natif_applications_mobiles
1
Développement natifd’applications mobiles
TechConf #1 - Telecom Valley / 4 juin 2014Nicolas GOUTALAND (Teach on Mars) - Michael LAGUERRE (Ausy)
Question
Sous quel OS tourne votre téléphone ?
2
Une multitude d’OS mobiles
3
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
Introduction
5
Evolution du traficwebsites vs applications
Evolution du traficwebsites
Introduction
6
Développement natif
• Performance
• Meilleure intégration
• Meilleur rendu
• Complexité des applications
7
Qui sommes-nous ?
Nicolas GOUTALAND
• Développement iOS depuis le premier SDK
• Plus d’une centaine d’applications
• CTO @Teach on Mars
8
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
Par où commencer ?
10
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
Prérequis
• Mac
• Création d’un Apple ID
• Choix d’une licence
12
iOS Developer Program
• 99$ (~80€) chaque année
• Licence personnelle ou entreprise
• Publication d’applications sur l’AppStore
• 100 devices de test
13
iOS Developer Enterprise Program
• 299$ (~250 €) chaque année
• Distributions d’applications internes à une entreprise (OTA)
• Pas de limites sur la distribution
14
Développer pour Android
15
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
Eclipse
17
Android Studio
18
Android SDK
19
ADT
Hierarchy Viewer Emulateur
draw9patch
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
Emulateur Android
21
Emulateur Android - Genymotion
22
10x plus rapideque l’émulateur Android
HierarchyViewer
23
draw9patch
24
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
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
Développer pour iOS
27
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
Xcode
29
AppCode
30
iOS Tools
31
Interface builder
32
Instruments
33
Reveal
34
• Objective-C
• [ ]
• Preprocesseur C
• Protocol / Category
• ARC
• Pas de NullPointerException ;)
35
Le langageObjective-C
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
37
L’autre langage Swift
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)!") }}
Une app mobile : un ensemble de composants
39
Une application mobile, c’est :
40
Interface graphique
Data
RéseauCapteurs
Services OS
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
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
Ressources et liens utiles
43
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
Tips AndroidLiens utiles
• http://developer.android.com/
• http://www.vogella.com/tutorials/android.html
48
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
• www.raywenderlich.com
• www.maniacdev.com
• www.cocoacontrols.com
• https://developer.apple.com
50
Tips iOSLiens utiles
Merci de votre attentionDes questions ?
51
?