I have a Java library that uses a few things from the Android APIs. I\'d like to use Mockito to write unit tests for this library.
Is there a way I can go about this? <
Take a look at android-mock. It's based on EasyMock 2.4 (so not quite as nice as Mockito but close).
It gets around the limitations of the DalvikVM by pre-generating the mock classes at build time rather than runtime, and then bunding them with your compiled test code when deploying to the device.
There's also a mocking framework called Borachio which I can't vouch for but looks promising (if you're happy to go through the motions of getting Scala to run on your device).