Slide 1

Slide 1 text

10-12 September 2015 droidcon Greece Thessaloniki

Slide 2

Slide 2 text

Preventing Analytics and Ads from polluting your codebase Lightweight android lifecycle annotations Savvas Dalkitsis Senior software engineer at Shazam @geeky_android

Slide 3

Slide 3 text

Analytics

Slide 4

Slide 4 text

Ads

Slide 5

Slide 5 text

AOP

Slide 6

Slide 6 text

Look at all the pretty diamonds

Slide 7

Slide 7 text

http://shazam.github.io/android-aspects/ android-aspects

Slide 8

Slide 8 text

DEMO

Slide 9

Slide 9 text

•  Use cautiously •  Only for pure cross cutting concerns •  Don’t be afraid to move aspects back to business logic if over time it becomes apparent that it belongs there •  For uber-cross-cutting concerns (like global session management) you can use Application.registerActivityCallbacks Conclusions AOP is very powerful but very dangerous. “If all you have is a hammer, everything looks like a nail”

Slide 10

Slide 10 text

•  Pageviews •  Ads •  Implicit userevent parameters (screen name plus more) •  FAB •  HierarchyViewer aspect for debugging •  more to come… How do we use this @Shazam?

Slide 11

Slide 11 text

Butterknife Aspects: https://github.com/savvasdalkitsis/butterknife-aspects Demo repo: https://github.com/savvasdalkitsis/android-aspects-example Examples

Slide 12

Slide 12 text

Savvas Dalkitsis Senior software engineer / Shazam @geeky_android Thank you! droidcon Greece Thessaloniki