June 2013
Intermediate to advanced
216 pages
6h 3m
English
In this chapter, we’ll cover two third-party libraries. The first one lets you use aspect-oriented programming inside an Android application. The second is a game framework. We’ll walk through what’s possible when you add them to your application.
Have you ever tried to add analytics, ads, and logs to an Android Activity? If you have, you know that your class can get polluted with a lot of code that has nothing to do with your Activity’s logic. In this hack, you’ll see how to solve this issue using aspect-oriented programming (AOP). As an example, we’ll add a log statement to the Activity’s onCreate() method using AOP to make sure that the Activity doesn’t ...