Embedded webserver implementation and usage - DroidCon Paris 2014

Post on 02-Dec-2014

120 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

http://fr.droidcon.com/2014/agenda/ http://fr.droidcon.com/2014/agenda/detail?title=Embed+HTTP+micro+server+in+your+app Guilhem Duché, iD.apps

Transcript

Micro serveur http embarqué

usages et implémentations

HTTP

1. Introduction2. Pour quoi faire ?3. Solutions techniques4. Affichage d’informations5. Partage de fichiers6. Avec un chromecast7. 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 œuvre 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 Fileshttps://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

@theguiguito

https://github.com/guiguito

iD.appshttp://www.id-apps.fr

http://blog.id-apps.info

@iD_apps

Guilhem DUCHE

DemainQuentin Sallat : passage de Holo à Material Design

top related