12
Android Push Notifications Barcelona Android User Group May 2014

Android push notifications

Embed Size (px)

Citation preview

Page 1: Android push notifications

Android Push Notifications

Barcelona Android User Group May 2014

Page 2: Android push notifications

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

Page 3: Android push notifications

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

Page 4: Android push notifications
Page 5: Android push notifications

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

Page 6: Android push notifications

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

Page 7: Android push notifications

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

Page 8: Android push notifications

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

Page 9: Android push notifications

Choosing a solution

Message Broker Maintenance Difficulty

ZeroMQ Yes Hard

Redis Yes Easy

Custom QMS Yes Easier

GCM Push Notifications No Easiest

Page 10: Android push notifications

Services architecture

Apache Cordova

VPN

BusyBox

ADB

SSH

JavaScript player

SuperSU

scheduler

Downloader

Uploader

Page 11: Android push notifications

Services architecture

BusyBoxSuperSU DownloaderUploader

scheduler

Apache Cordova

JavaScript playerPush

Notifications

IntentIntent

Runtime.getRuntime().exec()