Post on 22-Jun-2015
Android Push Notifications
Barcelona Android User Group May 2014
Hello worldClients
OrangeEl Corte Inglés
EndesaSodexo
IkeaNespresso
Fira BarcelonaAjuntament de Barcelona
ESADEThe Phone House
The company20 peopleDigital SignageUser Interactivity
ProjectsSpain United Kingdom GermanyNetherlandsFinland
www.focusonemotions.com@focusonemotions
Hello world
Orestes Carracedo
8 years as a developer4 years as an Android user3,5 years at Focus On Emotions
Certified SCRUM MasterPHP 5.3 Zend Certified Engineer
Read about mehttp://blog.orestes.io
Follow me@orestesCA
Briefing
Make it on timeCode as less as possible
Be robustMake use of existing OS toolsMake use of existing apps
Be flexibleCreate multiple decoupled tools that work together
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
Remote access$ 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
Pushing content updates
Problem
● 280 devices● Intermittent connectivity
Solution
● Parallelisation● Retries, reporting
Queue SystemThread #1 ./update-content --device 10 --content 15Thread #2 ./update-content --device 11 --content 15
Waiting … ./update-content --device 12 --content 16
ADB cap
Choosing a solution
Message Broker Maintenance Difficulty
ZeroMQ Yes Hard
Redis Yes Easy
Custom QMS Yes Easier
GCM Push Notifications No Easiest
Services architecture
Apache Cordova
VPN
BusyBox
ADB
SSH
JavaScript player
SuperSU
scheduler
Downloader
Uploader
Services architecture
BusyBoxSuperSU DownloaderUploader
scheduler
Apache Cordova
JavaScript playerPush
Notifications
IntentIntent
Runtime.getRuntime().exec()