DroidFu and GreenDroid are great open source projects which I would like to utilize in my Android project. However, I ran into a problem when trying to get them work at the same time.
Both of these libraries require that the application derives from their base application class, DroidFuApplication and GDApplication, respectively. Naturally, I thought I would have to modify the code by making another one of them extend the other. Is this the case?
How can I most painlessly import both of these libraries and use them in my project? How would you approach this problem? Would you just merge the best (or needed) parts of both of the frameworks? Or, is there a simpler way?
Yes, and hope that it works.
Personally, I'd ask the developers of those libraries to use ordinary singletons and quit extending
Application
, or expect the customApplication
to implement some library-defined interface with a stock customApplication
implementation of same, or otherwise support this sort of scenario.But that's just me. :-)
That may or may not be practical, depending on what you want from them and how easily it can be teased out from the framework (and custom
Application
dependency). You might want to consider finding an alternative to one of them that has the feature(s) you need and does not have a customApplication
dependency.