otto - an android event bus

21
An Android Event Bus Otto

Upload: lucas-albuquerque

Post on 12-Jan-2017

368 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Otto - An Android Event Bus

An Android Event Bus

Otto

Page 2: Otto - An Android Event Bus

About me

Lucas AlbuquerqueMobile / Backend Developer @ M4U

ContactsE-mail: [email protected]

Linkedin: linkedin.com/in/lucasalbuquerque Github: github.com/lalbuquerque

SlideShare: slideshare.net/olucasalbuquerque

Page 3: Otto - An Android Event Bus

The problem

Page 4: Otto - An Android Event Bus

The problem

Page 5: Otto - An Android Event Bus

A light at the end of the tunnel…

Page 6: Otto - An Android Event Bus
Page 7: Otto - An Android Event Bus

Setting up

Page 8: Otto - An Android Event Bus

Setting up

Page 9: Otto - An Android Event Bus

Setting up

Page 10: Otto - An Android Event Bus
Page 11: Otto - An Android Event Bus

SUBPUB

EventBus.publish(new MyEvent());@EventSubscriber(eventClass = MyEvent.class)

Page 12: Otto - An Android Event Bus

But how is it all with Otto?

Page 13: Otto - An Android Event Bus

SUB:

Page 14: Otto - An Android Event Bus

PUB:

Page 15: Otto - An Android Event Bus
Page 16: Otto - An Android Event Bus

Producers

@Producepublic Beyonce produce() {

return new Beyonce(); }

Page 17: Otto - An Android Event Bus
Page 18: Otto - An Android Event Bus
Page 19: Otto - An Android Event Bus
Page 20: Otto - An Android Event Bus
Page 21: Otto - An Android Event Bus

References:

http://square.github.io/otto/

https://asherson.wordpress.com/2013/02/20/otto-event-bus-for-android/

http://www.vogella.com/tutorials/JavaLibrary-EventBusOtto/article.html

https://corner.squareup.com/2012/07/otto.html

https://github.com/square/otto/issues/27

http://nick.perfectedz.com/otto-event-system/