Chapter 7. Useful libraries

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.

Hack 31 Aspect-oriented programming in Android: Android v1.6+

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 ...

Get 50 Android Hacks now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.