Micro serveur http embarqué 
usages et implémentations 
HTTP
1. Introduction 
2. Pour quoi faire ? 
3. Solutions techniques 
4. Affichage d’informations 
5. Partage de fichiers 
6. Avec un chromecast 
7. Conclusion
1. Introduction
1. Introduction 
Comment échanger entre différents devices 
localement ? 
Bluetooth => appairage 
QRCode => limité 
NFC => peu de données, forte proximité 
Push => réactivité, débit, compatibilité 
Réseau local => Wifi + Serveur HTTP
2. Pour quoi faire ?
2. Pour quoi faire ? 
Exemples d’applications : 
▪ Envoi de données dans une application iPad 
▪ Airdroid 
▪ SuperBeam 
Différents types d’usages 
▪ Affichage/envoi d’information 
▪ Partage de fichiers 
▪ Serveur accessible localement
3. Solutions techniques
3. Solutions techniques 
Objectif => pas d’usine à gaz 
NanoHttpd : 
▪ 1 fichier 
▪ Support complet http 1.1 
▪ Facile à modifier 
https://github.com/NanoHttpd/nanohttpd 
Restlet 
▪ Simple pour mise en oeuvre API Rest 
http://restlet.com/
4. Affichage d’informations
4. Affichage d’informations 
Projet client avec forte synchronisation DB 
Comment débugguer une base SQLite rapidement 
Librairie Cardeto : 
▪ DB Browsing 
▪ Logcat 
▪ Clipboard 
▪ Static variables 
▪ App info 
https://github.com/guiguito/Cardeto
4. Implémentation/démo 
Permissions nécessaires 
Surcharger le comportement de nanoHttpd
5. Partage de fichiers
5. Partage de fichiers 
Partage android via wifi 
▪ Fichiers 
▪ Images 
▪ Vidéos 
▪ Contact 
▪ Position Google maps 
▪ Textes 
AIRShare 
▪ Superbeam light 
▪ Open source 
▪ NFC/QRCode 
https://github.com/guiguito/AIRShare
5. Implémentation/démo 
Partage de fichier avec nano httpd 
IP du smarphone en AP
6. Avec un chromecast
6. Architecture d’une 
application chromecast
6. Idée d’application chromecast 
Faire une présentation avec un chromecast 
▪ PPT 
▪ PDF 
Pas de libs java pour les PPT 
Héberger un site dans assets 
SlidesCast 
▪ SlideShare 
▪ Local Files 
https://github.com/guiguito/SlidesCast
Architecture (1/2) 
Browser HTML 5 
iFrame
Architecture (2/2)
Implémentation 
Data centric chromecast app 
Chromecast : 
▪ iFrame 
▪ HTML 5 post message 
Smartphone : 
▪ Cast Companion Library 
▪ SlideShare API 
▪ Viewer.js => support de postmessage 
▪ NanoHttpd => support des Assets
7. Conclusion
Implémentation/démo 
Wifi is not dead 
Ne pas se priver d’un serveur HTTP embarqué 
▪ Simple à utiliser 
▪ Simple à modifier 
▪ Efficace 
▪ Compatibilité du HTTP 
Mixer : site web + webservices 
Très bon moyen de faire communiquer différents 
types de devices connectés
iD.apps 
http://www.id-apps.fr 
http://blog.id-apps.info 
@iD_apps 
Guilhem DUCHE 
@theguiguito 
https://github.com/guiguito 
Demain 
Quentin Sallat : passage de Holo à Material Design

Embedded webserver implementation and usage - DroidCon Paris 2014

  • 1.
    Micro serveur httpembarqué usages et implémentations HTTP
  • 2.
    1. Introduction 2.Pour quoi faire ? 3. Solutions techniques 4. Affichage d’informations 5. Partage de fichiers 6. Avec un chromecast 7. Conclusion
  • 3.
  • 4.
    1. Introduction Commentéchanger entre différents devices localement ? Bluetooth => appairage QRCode => limité NFC => peu de données, forte proximité Push => réactivité, débit, compatibilité Réseau local => Wifi + Serveur HTTP
  • 5.
    2. Pour quoifaire ?
  • 6.
    2. Pour quoifaire ? Exemples d’applications : ▪ Envoi de données dans une application iPad ▪ Airdroid ▪ SuperBeam Différents types d’usages ▪ Affichage/envoi d’information ▪ Partage de fichiers ▪ Serveur accessible localement
  • 7.
  • 8.
    3. Solutions techniques Objectif => pas d’usine à gaz NanoHttpd : ▪ 1 fichier ▪ Support complet http 1.1 ▪ Facile à modifier https://github.com/NanoHttpd/nanohttpd Restlet ▪ Simple pour mise en oeuvre API Rest http://restlet.com/
  • 9.
  • 10.
    4. Affichage d’informations Projet client avec forte synchronisation DB Comment débugguer une base SQLite rapidement Librairie Cardeto : ▪ DB Browsing ▪ Logcat ▪ Clipboard ▪ Static variables ▪ App info https://github.com/guiguito/Cardeto
  • 11.
    4. Implémentation/démo Permissionsnécessaires Surcharger le comportement de nanoHttpd
  • 12.
    5. Partage defichiers
  • 13.
    5. Partage defichiers Partage android via wifi ▪ Fichiers ▪ Images ▪ Vidéos ▪ Contact ▪ Position Google maps ▪ Textes AIRShare ▪ Superbeam light ▪ Open source ▪ NFC/QRCode https://github.com/guiguito/AIRShare
  • 14.
    5. Implémentation/démo Partagede fichier avec nano httpd IP du smarphone en AP
  • 15.
    6. Avec unchromecast
  • 16.
    6. Architecture d’une application chromecast
  • 17.
    6. Idée d’applicationchromecast Faire une présentation avec un chromecast ▪ PPT ▪ PDF Pas de libs java pour les PPT Héberger un site dans assets SlidesCast ▪ SlideShare ▪ Local Files https://github.com/guiguito/SlidesCast
  • 18.
  • 19.
  • 20.
    Implémentation Data centricchromecast app Chromecast : ▪ iFrame ▪ HTML 5 post message Smartphone : ▪ Cast Companion Library ▪ SlideShare API ▪ Viewer.js => support de postmessage ▪ NanoHttpd => support des Assets
  • 21.
  • 22.
    Implémentation/démo Wifi isnot dead Ne pas se priver d’un serveur HTTP embarqué ▪ Simple à utiliser ▪ Simple à modifier ▪ Efficace ▪ Compatibilité du HTTP Mixer : site web + webservices Très bon moyen de faire communiquer différents types de devices connectés
  • 23.
    iD.apps http://www.id-apps.fr http://blog.id-apps.info @iD_apps Guilhem DUCHE @theguiguito https://github.com/guiguito Demain Quentin Sallat : passage de Holo à Material Design