I have found that I have to very carefully separate the "controller" and "view" code (which depends on the Android Framework) from the "model" code (which doesn't). I can then write standard JUnit unit tests against the model classes, and have them running as part of the test phase of a
Maven build. In order to support this I have had to abstract a few things:
* I have an interface that will yield a file. For the code running on Android I have a class that yields a file on the sdcard. For the unit test I have a class that yields a file in the target directory.
* I have had to also factor out the logging so that on Android I use the Android logger and in the unit tests I use commons logging with Log4J (my next experiment will be if i can use commons logging on Android itself which should make logging easier).
I'm sure I will find more issues as I got further one. Essentially, anyplace in my model classes where I think I might need to use an Android class I will have to create an interface instead and supply an alternate implementation for the unit tests.