Android as a digital signage platform
Upcoming SlideShare
Loading in...5

Android as a digital signage platform






Total Views
Views on SlideShare
Embed Views



5 Embeds 956 934 15 4 2 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Android as a digital signage platform Android as a digital signage platform Presentation Transcript

  • Android as a Digital Signage platform Barcelona Android User Group October 2013
  • Hello world Clients Orange El Corte Inglés Endesa Sodexo Ikea Nespresso Fira Barcelona Ajuntament de Barcelona ESADE The Phone House The company 20 people Digital Signage User Interactivity Projects Spain United Kingdom Germany Netherlands Finland @focusonemotions
  • Hello world Orestes Carracedo 8 years as a developer 4 years as an Android user 3,5 years at Focus On Emotions Certified SCRUM Master PHP 5.3 Zend Certified Engineer Read about me Follow me @orestesCA
  • What’s Digital Signage?
  • What’s Digital Signage?
  • What’s Digital Signage?
  • Challenge Break out of the player app and you’ll get a reward ● Try to guess the unlock gesture ● Try to guess the unlock code ● No buttons ● No fastboot
  • Start
  • Briefing Make it on time Code as less as possible Be robust Make use of existing OS tools Make use of existing apps Be flexible Create multiple decoupled tools that work together
  • System architecture Apache Cordova V P N BusyBox A D B S S H JavaScript player SuperSU scheduler
  • Prototype
  • Quick ADB recap $ adb devices List of devices attached 4df144cb39376f2f device # Over USB device # Over NET $ adb shell echo “Hello world” Hello world $ adb -d shell ls /mnt/sdcard $ adb -s shell ls /mnt/sdcard Enable ADB over Wi-Fi $ adb shell setprop service.adb.tcp.port 5555 $ adb shell stop adbd && start adbd # or you’ll be locked out $ adb connect
  • Quick ADB recap Sending keys $ adb shell input keyevent 3 # home Starting activities $ adb shell am start -n Killing a process $ adb shell killall Installing apps $ adb install foe-player-v1.1.apk $ adb push foe-player-v1.1.apk /system/app Android Monitor <android-sdk>/tools/monitor
  • Features
  • Player Cordova Screen rotation Read start URL Provide OS access JavaScript Display content Read content index file Listen for gesture Ask for code Show config manager
  • Scheduler Power management $ reboot # (duh) Screen state management $ input keyevent 26 # power $ input keyevent 82 # menu Player state management $ killall $ am start -n com.[...].player/.Wrapper
  • Restricted user access ● Kill UI process ● Custom launcher AndroidManifest <category android:name="android.intent.category.HOME" /> /system/build.prop qemu.hw.mainkeys=1 ● Custom ROM
  • Local configuration manager Content Index file Player configuration file Configuration manager Content player
  • Static IP address $ openvpn --config /mnt/sdcard/focus/openvpn/conn.conf > /mnt/sdcard/focus/openvpn/run.log & $ cat /mnt/sdcard/focus/openvpn/conn.conf | grep resolv resolv-retry infinite
  • Remote shell $ adb connect $ time adb connect unable to connect to real 1m3.163s user 0m0.000s sys 0m0.020s . . $ time timeout 9s adb connect real 0m9.003s user 0m0.000s sys 0m0.020s
  • Screen capture $ adb shell screencap /mnt/sdcard/focus/capture.png $ adb pull /mnt/sdcard/focus/capture.png $ ./ oratab-030-01 Getting screencap from oratab-030-01 ... done.
  • Wi-Fi management $ echo "12345678" | wpa_passphrase "SSID" # reading passphrase from stdin network={ ssid="SSID" #psk="12345678" psk=34b59e6b0182725d42460 [...] } $ wpa_passphrase "SSID" "12345678" # may malfunction $ wpa_passphrase "SSID" # may malfunction # reading passphrase from stdin Android Wi-fi/WPA settings /data/misc/wifi/wpa_supplicant.conf
  • Content management $ adb push /local/folder /remote/folder PHP SFTP Wrapper $ php load-device-content.php 300 7 Loading content … 50 % 20/40 KB 100 % 40/40 KB Done. /mnt/sdcard/focus + openvpn + player + scheduler + upload - content - october_2013 + media
  • Statistics & graphs
  • Statistics & graphs Whisper database (updates to past data) Carbon aggregation (Use an IP, not a hostname UDP is better than TCP, is off by default) Graphite for rendering $ /opt/graphite/bin/ start --debug $ echo ‘value.received’ `date +%s` | nc -w 1 2003 StatsD/statsite as aggregator/proxy (v8 nodejs vs C) <?php StatsD::increment(‘’);
  • Platforming
  • 1. Plug device in 2. Enable ADB over USB 3. Launch script 4. Enter ID 5. Done! Check ● PING ● SFTP ● SSH ● ADB Platforming
  • $ sftp root@ bash: /usr/libexec/sftp-server: No such file or directory $ sftp -s /system/xbin/sftp-server root@ sftp> # quick fix [adb] $ ln -s /system/xbin/sftp-server /usr/libexec/sftp-server Install SuperSU + settings Install BusyBox Install DropBearSSH Fix SFTP subsystem Install player Install scheduler Install OpenVPN certificates from ID Reboot Platforming
  • Ha ha!
  • Monitoring with Nagios
  • Monitoring with Nagios $ php check-device-content.php Up-to-date $ php check-device-content.php Out of date
  • Monitoring with Nagios <?xml version="1.0" encoding="UTF-8"?> <nagios_status> <hosts> <host name="dev-001"> <status last_change="2013-10-08T16:27:37+02:00">0</status> <connectivity last_change="2013-10-08T16:27:37+02:00">0</connectivity> <content last_change="2013-10-08T16:27:37+02:00">0</content> <sftp last_change="2013-10-08T16:27:37+02:00">0</sftp> </host> [...]
  • Questions?
  • dev@focusonemotions Thank you! Feedback Team Juanra Posada Orestes Carracedo Javier Morales Dimas López Raúl Jiménez Javier Domingo Gonzalo Rodríguez Project Manager Lead Developer Developers JavaScript Ninja Sistemas