Android - Looking for an AOP solution

Posted by Serj Lotutovici on Stack Overflow See other posts from Stack Overflow or by Serj Lotutovici
Published on 2013-01-22T13:25:50Z Indexed on 2014/08/21 22:20 UTC
Read the original article Hit count: 297

I'm writing an application that on the bottom line uses it's internal API for some manipulations. The problem is that to call any method provided by that class first I (or anybody who uses the API) have to call #prepare() and after that #cleanup(). It all worked fine until the application and the API started to grow. And the risk of not calling one of the supplied methods before or after the API is now to big to be ignored (which makes it a bug risky application).

Searching for a solution I found this question. I use Google Guice in my app for other purposes, but Android doesn't support AOP, that's why a use only guice-no_aop-x.jar.

So I end-up with two questions: Is there an AOP solution for android to implement the same approach that is shown in the link above? Or may be someone has an idea that will be suitable for my case?

Thanks in advice!

© Stack Overflow or respective owner

Related posts about android

Related posts about dependency-injection