Using both DroidFu and GreenDroid in an Android project

628 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

Naturally, I thought I would have to modify the code by making another one of them extend the other. Is this the case?

Yes, and hope that it works.

How would you approach this problem?

Personally, I'd ask the developers of those libraries to use ordinary singletons and quit extending Application, or expect the custom Application to implement some library-defined interface with a stock custom Application implementation of same, or otherwise support this sort of scenario.

But that's just me. :-)

Would you just merge the best (or needed) parts of both of the frameworks?

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 custom Application dependency.