SlideShare una empresa de Scribd logo
1 de 44
Descargar para leer sin conexión
Android as a Digital Signage platform

Betabeers Barcelona November 2013
Hello world
The company

Clients

20 people

Orange

Digital Signage

El Corte Inglés

User Interactivity

Endesa
Sodexo

Projects
Spain
United Kingdom
Germany
Netherlands
Finland

www.focusonemotions.com
@focusonemotions

Ikea
Nespresso
Fira Barcelona
Ajuntament de Barcelona
ESADE
The Phone House
Hello world
Orestes Carracedo
8 years as a developer
4 years as an Android user
3,5 years at Focus On Emotions
Software Development Director
Certified SCRUM Master
PHP 5.3 Zend Certified Engineer

Read about me
http://blog.orestes.io

Follow me
@orestesCA
What’s Digital Signage?
What’s Digital Signage?
The beginning
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

A
D
B

API Client

JavaScript player
V
P
N

cron

scheduler

SuperSU
BusyBox

HTTP API

S
S
H

CLI API
Prototype

http://vimeo.com/72032877
Let’s do it!
Quick ADB recap
$ adb devices
List of devices attached
4df144cb39376f2f
device # Over USB
192.168.1.42:5555
device # Over NET
$ adb shell echo “Hello world”
Hello world
$ adb -d shell ls /mnt/sdcard
$ adb -s 192.168.1.42:5555 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 192.168.1.42:5555
Quick ADB recap
Sending keys
$ adb shell input keyevent 3 # home
Starting activities
$ adb shell am start -n com.focusonemotions.android.player./Wrapper
Killing a process
$ pm stop com.focusonemotions.android.player
Installing apps
$ adb install foe-player-v1.1.apk
$ adb push foe-player-v1.1.apk /system/app

Android Monitor
<android-sdk>/tools/monitor
http://developer.android.com/reference/android/view/KeyEvent.html
Features
Player
Cordova
Rotates screen
Shows WebView
Provides OS shell access

JavaScript
Displays content
Reads content index file
Listens for gesture
Asks for security code
Shows config manager
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
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/
Local configuration manager
Content Index file

Configuration manager

Player configuration file

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

https://play.google.com/store/apps/details?id=de.schaeuffelhut.android.openvpn.installer
https://play.google.com/store/apps/details?id=de.blinkt.openvpn
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
user
sys

1m3.163s
0m0.000s
0m0.020s

$ time timeout 9s adb connect 192.168.1.42
real
user
sys

0m9.003s
0m0.000s
0m0.020s
Screen capture
$ adb shell screencap /mnt/sdcard/focus/capture.png
$ adb pull /mnt/sdcard/focus/capture.png
$ ./capture.sh 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

/mnt/sdcard/focus
+ openvpn
+ player

$ php load-device-content.php 300 7

+ scheduler

Loading content …

+ upload

50 % 20/40 KB
100 % 40/40 KB
Done.

- 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/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
Platforming
Platforming
1.
2.
3.
4.
5.

Plug device in
Enable ADB over USB
Launch script
Enter ID
Done!

Check
●
●
●
●

PING
SFTP
SSH
ADB
Platforming
Install SuperSU + settings
Install BusyBox
Install DropBearSSH
Fix SFTP subsystem
Install player
Install scheduler
Install OpenVPN certificates from ID
Reboot
$ sftp root@192.168.1.42:mnt/sdcard/focus
bash: /usr/libexec/sftp-server: No such file or directory
$ sftp -s /system/xbin/sftp-server root@192.168.1.42:mnt/sdcard/focus
sftp>
# quick fix
[adb] $ ln -s /system/xbin/sftp-server /usr/libexec/sftp-server
http://www.chainfire.eu/projects/52/SuperSU/
https://play.google.com/store/apps/details?id=stericson.busybox
https://github.com/yath/android_external_dropbear
Content Management System
Testing
Testing
Quick feedback
Acceptance Tests
● CLI API
● Web API
Physical testing devices
Testing
Scenario Outline: Get a list of cities based on the passed parameters
Given I have an endpoint "http://api.pushmaster.focusonemotions.com/1.0/city/"
And I pass an argument "id" "<id>"
And I pass an argument "title" "<title>"
When I make a "<method>" request to the endpoint
Then I should get a valid response "<response>"
Examples:
| method
| GET
| GET
| GET
| GET
| GET

| id | title
|
|
| 1 |
|
| Hobbiton
| -1 |
|
| FOO

|
|
|
|
|
|

response
city/city-list.json
city/city-get-by-id.json
city/city-get-by-title.json
null.json
null.json

|
|
|
|
|
|
All done
Ha ha!
Monitoring with Nagios
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
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>
[...]
Thank you!
Feedback
orestes.ca@gmail.com

Team
Project Manager Juanra Posada
Lead Developer Orestes Carracedo
Developers Javier Morales
Dimas López

http://www.focusonemotions.com

JavaScript Ninja Raúl Jiménez
System Administrators Javier Domingo

dev@focusonemotions

Gonzalo Rodríguez
Challenge
Break out of the player app, win an
Amazon gift card!
●
●
●
●

Try to guess the unlock gesture
Try to guess the unlock code
No buttons
No fastboot

Más contenido relacionado

La actualidad más candente

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
Opersys inc.
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Native Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developersNative Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developers
Jorge Arteiro
 
How to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew SuarezHow to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew Suarez
Shakacon
 
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
Aditya K Sood
 

La actualidad más candente (20)

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
drone continuous Integration
drone continuous Integrationdrone continuous Integration
drone continuous Integration
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Log 2012.04.09 07.48.24
Log   2012.04.09 07.48.24Log   2012.04.09 07.48.24
Log 2012.04.09 07.48.24
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Drone 1.0 Feature
Drone 1.0 FeatureDrone 1.0 Feature
Drone 1.0 Feature
 
The Future of Firefox and JavaScript
The Future of Firefox and JavaScriptThe Future of Firefox and JavaScript
The Future of Firefox and JavaScript
 
@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb
 
Native Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developersNative Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developers
 
Android open source project build system phi innovations - android summit 2015
Android open source project build system   phi innovations - android summit 2015Android open source project build system   phi innovations - android summit 2015
Android open source project build system phi innovations - android summit 2015
 
How to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew SuarezHow to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew Suarez
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Root via XSS
Root via XSSRoot via XSS
Root via XSS
 
Random numbers
Random numbersRandom numbers
Random numbers
 
Selenium&amp;behave introduction
Selenium&amp;behave introductionSelenium&amp;behave introduction
Selenium&amp;behave introduction
 
Red Hat, CentOS, Fedora 2019
Red Hat, CentOS, Fedora 2019Red Hat, CentOS, Fedora 2019
Red Hat, CentOS, Fedora 2019
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruption
 
44CON London 2015 - Is there an EFI monster inside your apple?
44CON London 2015 - Is there an EFI monster inside your apple?44CON London 2015 - Is there an EFI monster inside your apple?
44CON London 2015 - Is there an EFI monster inside your apple?
 
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
 

Similar a Betabeers Android as a Digital Signage platform

Android as a digital signage platform
Android as a digital signage platformAndroid as a digital signage platform
Android as a digital signage platform
BeMyApp
 
DomDisc and the Domino data api
DomDisc and the Domino data apiDomDisc and the Domino data api
DomDisc and the Domino data api
Jens Bruntt
 

Similar a Betabeers Android as a Digital Signage platform (20)

Android as a digital signage platform
Android as a digital signage platformAndroid as a digital signage platform
Android as a digital signage platform
 
Android as a digital signage platform
Android as a digital signage platformAndroid as a digital signage platform
Android as a digital signage platform
 
Android Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoTAndroid Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoT
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
DomDisc and the Domino data api
DomDisc and the Domino data apiDomDisc and the Domino data api
DomDisc and the Domino data api
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
Developing Cross Platform Applications with Golang
Developing Cross Platform Applications with GolangDeveloping Cross Platform Applications with Golang
Developing Cross Platform Applications with Golang
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 
Orchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxOrchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded Linux
 
Orchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxOrchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded Linux
 
Linux Security and How Web Browser Sandboxes Really Work (NDC Oslo 2017)
Linux Security  and How Web Browser Sandboxes Really Work (NDC Oslo 2017)Linux Security  and How Web Browser Sandboxes Really Work (NDC Oslo 2017)
Linux Security and How Web Browser Sandboxes Really Work (NDC Oslo 2017)
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Betabeers Android as a Digital Signage platform

  • 1. Android as a Digital Signage platform Betabeers Barcelona November 2013
  • 2. Hello world The company Clients 20 people Orange Digital Signage El Corte Inglés User Interactivity Endesa Sodexo Projects Spain United Kingdom Germany Netherlands Finland www.focusonemotions.com @focusonemotions Ikea Nespresso Fira Barcelona Ajuntament de Barcelona ESADE The Phone House
  • 3. Hello world Orestes Carracedo 8 years as a developer 4 years as an Android user 3,5 years at Focus On Emotions Software Development Director Certified SCRUM Master PHP 5.3 Zend Certified Engineer Read about me http://blog.orestes.io Follow me @orestesCA
  • 6.
  • 7.
  • 9. 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
  • 10. System architecture Apache Cordova A D B API Client JavaScript player V P N cron scheduler SuperSU BusyBox HTTP API S S H CLI API
  • 13. Quick ADB recap $ adb devices List of devices attached 4df144cb39376f2f device # Over USB 192.168.1.42:5555 device # Over NET $ adb shell echo “Hello world” Hello world $ adb -d shell ls /mnt/sdcard $ adb -s 192.168.1.42:5555 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 192.168.1.42:5555
  • 14. Quick ADB recap Sending keys $ adb shell input keyevent 3 # home Starting activities $ adb shell am start -n com.focusonemotions.android.player./Wrapper Killing a process $ pm stop com.focusonemotions.android.player Installing apps $ adb install foe-player-v1.1.apk $ adb push foe-player-v1.1.apk /system/app Android Monitor <android-sdk>/tools/monitor http://developer.android.com/reference/android/view/KeyEvent.html
  • 16. Player Cordova Rotates screen Shows WebView Provides OS shell access JavaScript Displays content Reads content index file Listens for gesture Asks for security code Shows config manager
  • 17. 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
  • 18. 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/
  • 19. Local configuration manager Content Index file Configuration manager Player configuration file Content player
  • 20. 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 https://play.google.com/store/apps/details?id=de.schaeuffelhut.android.openvpn.installer https://play.google.com/store/apps/details?id=de.blinkt.openvpn
  • 21. 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 user sys 1m3.163s 0m0.000s 0m0.020s $ time timeout 9s adb connect 192.168.1.42 real user sys 0m9.003s 0m0.000s 0m0.020s
  • 22. Screen capture $ adb shell screencap /mnt/sdcard/focus/capture.png $ adb pull /mnt/sdcard/focus/capture.png $ ./capture.sh oratab-030-01 Getting screencap from oratab-030-01 ... done.
  • 23. 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
  • 24. Content management $ adb push /local/folder /remote/folder PHP SFTP Wrapper /mnt/sdcard/focus + openvpn + player $ php load-device-content.php 300 7 + scheduler Loading content … + upload 50 % 20/40 KB 100 % 40/40 KB Done. - content - october_2013 + media
  • 26. 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
  • 28. Platforming 1. 2. 3. 4. 5. Plug device in Enable ADB over USB Launch script Enter ID Done! Check ● ● ● ● PING SFTP SSH ADB
  • 29. Platforming Install SuperSU + settings Install BusyBox Install DropBearSSH Fix SFTP subsystem Install player Install scheduler Install OpenVPN certificates from ID Reboot $ sftp root@192.168.1.42:mnt/sdcard/focus bash: /usr/libexec/sftp-server: No such file or directory $ sftp -s /system/xbin/sftp-server root@192.168.1.42:mnt/sdcard/focus sftp> # quick fix [adb] $ ln -s /system/xbin/sftp-server /usr/libexec/sftp-server http://www.chainfire.eu/projects/52/SuperSU/ https://play.google.com/store/apps/details?id=stericson.busybox https://github.com/yath/android_external_dropbear
  • 31.
  • 32.
  • 33.
  • 35. Testing Quick feedback Acceptance Tests ● CLI API ● Web API Physical testing devices
  • 36. Testing Scenario Outline: Get a list of cities based on the passed parameters Given I have an endpoint "http://api.pushmaster.focusonemotions.com/1.0/city/" And I pass an argument "id" "<id>" And I pass an argument "title" "<title>" When I make a "<method>" request to the endpoint Then I should get a valid response "<response>" Examples: | method | GET | GET | GET | GET | GET | id | title | | | 1 | | | Hobbiton | -1 | | | FOO | | | | | | response city/city-list.json city/city-get-by-id.json city/city-get-by-title.json null.json null.json | | | | | |
  • 39.
  • 41. 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
  • 42. 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> [...]
  • 43. Thank you! Feedback orestes.ca@gmail.com Team Project Manager Juanra Posada Lead Developer Orestes Carracedo Developers Javier Morales Dimas López http://www.focusonemotions.com JavaScript Ninja Raúl Jiménez System Administrators Javier Domingo dev@focusonemotions Gonzalo Rodríguez
  • 44. Challenge Break out of the player app, win an Amazon gift card! ● ● ● ● Try to guess the unlock gesture Try to guess the unlock code No buttons No fastboot