DevoxxFR 2024 Reproducible Builds with Apache Maven
Android as a digital signage platform
1. Android as a Digital Signage platform
Barcelona Android User Group October 2013
2. 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
www.focusonemotions.com
@focusonemotions
3. 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
http://blog.orestes.io
Follow me
@orestesCA
8. 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
10. 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
17. 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
18. Scheduler
Power management
$ reboot # (duh)
Screen state management
$ input keyevent 26 # power
$ input keyevent 82 # menu
Player state management
$ killall com.focusonemotions.android.player
$ am start -n com.[...].player/.Wrapper
http://developer.android.com/reference/android/view/KeyEvent.html
19. 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
http://thebitplague.wordpress.com/2013/04/05/kiosk-mode-on-the-nexus-7/
22. Remote shell
$ adb connect 192.168.1.42:5555
$ time adb connect 192.168.1.42:5555
unable to connect to 192.168.1.42:5555
real 1m3.163s
user 0m0.000s
sys 0m0.020s
.
.
$ time timeout 9s adb connect 192.168.1.42
real 0m9.003s
user 0m0.000s
sys 0m0.020s
27. 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/carbon-cache.py start --debug
$ echo ‘value.received’ `date +%s` | nc -w 1 127.0.0.1 2003
StatsD/statsite as aggregator/proxy (v8 nodejs vs C)
<?php StatsD::increment(‘com.focusonemotions.app.pushing’);
http://graphite.readthedocs.org/en/latest/
https://github.com/etsy/statsd/
https://github.com/armon/statsite
33. Monitoring with Nagios
$ php check-device-content.php 192.168.1.42
Up-to-date
$ php check-device-content.php 192.168.1.42
Out of date
http://nagios.sourceforge.net/docs/3_0/quickstart.html