Dan Allen, Aslak Knutsen and I had a quick conversation today regarding integration with Transfuse and wanted to share the idea with the community with the hope of further discussion, ideas, collaboration, etc.

The idea is this: Test on Android utilizing Transfuse just like you can test on a JEE server utilizing CDI.

Transfuse (http://androidtransfuse.org/) is a dependency injection and integration framework for Android. It takes a bunch of ideas from Seam/CDI and other web tier frameworks an applies them to the mobile application space. Transfuse gives you JSR330 dependency injection, POJO components and a number of other cool features. It does all this though a variety of code generation techniques during compile time. This means your Android code is super quick, even during a cold start (which is extremely frequent). Testing is aided by the fact that you don't have to extend the Activity or other component classes. Also, dependency injection is built right in, so composing your application as a series of simple testable classes is a snap.

What I think would be groundbreaking in the Android space is to be able to test android components, running on a device and be able to make assertions on them just like Arquillian allows with Web applications. This is already possible using the Test Instrumentation code provided with the SDK, but clunky since you have to run your tests within a separate application project. Further, it would be great to be able to test the injectable components of Transfuse, just like with Seam.

Somewhat related, there are a couple of frameworks that bridge the gap between the emulator/phone and unit tests already. Robotium (http://code.google.com/p/robotium/) is a popular one that allows you to script the phone, much like Selenium does for the Web. Aslak mentioned that Robotium integration was a GSoC 12 proposal. I wonder if Arquillian could take these ideas a step further or have another perspective on the problem.

Personally, I need to study Arquillian a bit more to see where Transfuse can help. Optimally, I would like to see Transfuse being just another container that Arquillian can use to test on. In reality, there are some shortcomings of Android, like the lack of bytecode manipulation (... but you can create new bytecode: http://code.google.com/p/dexmaker/), that are challenges.

I saw your post in the Arquillian Android Container vs. Roboletric thread. Im interested what work you've done so far to ShrinkWrap an APK. Do you have a WIP hosted somewhere? If you're interested, Transfuse already has some code to generate the AndroidManifest.xml file that may be helpful in producing an APK.