tags:

views:

100

answers:

2

There is an option to create an Android JUnit Project.

As far as I am aware the other way is to create a folder in the same project called test which contains the same package name as the existing project.

What are the differences between these two methods.

A: 

When I develop in Java, I usually create a separate /test folder in the same project as my source, with the identical package structure underneath it.

I keep the two separate so that the /test contents don't get packaged up and deployed with the source code. No sense deploying tests or the 3rd party JARs on which they depend.

duffymo
So what is the use of an 'Android Test Project' then?
jax
Don't know, I'm just giving you my view for reference. I can cite what a separate /test folder is about; somebody else will have to help with the Android Test Project.
duffymo
A: 

Create a separate project. There's a number of reasons to do that, among others your tests won't be included in you final APK, you may need a different AndroidManifext.xml for your main project and for your tests and because it's a common practice and your project will be more understandable by others.

dtmilano