Tuesday, April 10, 2012

android: testing library projects

The latest Android SDK Tools (Revision 17 or greater) features several fixes related with library projects and the way the R class is now generated, and the way custom attributes for custom views are handled. This opens a greater number of possibilities using library projects and sooner or later you will be facing the need of testing the library.


Following there is a quick reference of how to do it for a sample library project called AndroidLibrary and its corresponding test project AndroidLibraryTest.

Create library project

Set properties to indicate it is a Library

Create test project and set the properties to reference the library

Set the Target package to this same test project

Run the tests

4 comments:

seetha said...

when i click new-android-android test project i am getting a window but it is not like the window shown by you.manifest file is also different.why it is like that?

Diego Torres Milano said...

Upload your screenshots somewhere and add the links to your post here so I can understand what's your problem.

musSharApp said...

can you post a sample project for this? Thanks!

Jay's Automation Experience said...

can you post a sample project for this? for Eclipse Juno android 4.1
Thanks!