Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6188655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:16:22+00:00 2026-05-24T02:16:22+00:00

This description of how to get started with testing in Android appears inconsistent: http://developer.android.com/guide/topics/testing/testing_android.html

  • 0

This description of how to get started with testing in Android appears inconsistent:

http://developer.android.com/guide/topics/testing/testing_android.html

It says:

A test project is a directory or Eclipse project in which you create
the source code, manifest file, and other files for a test package.
The Android SDK contains tools for Eclipse with ADT and for the
command line that create and update test projects for you. The tools
create the directories you use for source code and resources and the
manifest file for the test package.

However, then it says:

You can create a test project anywhere in your file system, but the
best approach is to add the test project so that its root directory
tests/ is at the same level as the src/ directory of the main
application’s project. This helps you find the tests associated with
an application.

Then it shows a project structure where all of your tests are under your main project and not a separate project. Yet, if you use the ADT plugin, it will create a separate project. Which is correct, or best practice — a separate project for unit tests, or the same project?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:16:22+00:00Added an answer on May 24, 2026 at 2:16 am

    It may be possible to create unit tests in a seperate project, but the way I’ve done it is just using a different package.

    This allows you to reference any classes you may need easily while creating your assert fields.

    The way I do it is have a package called com..Data.Tests and use the following to define my tests:

    public class AddressValidationTest extends
        ActivityInstrumentationTestCase2<InitialActivity>
    

    This allows you to keep everything within one project.

    Hope this helps!

    EDIT: It may be possible your confusion is coming from the Java terminology of projects vs. packages vs. classes. I think in this case, when they say a “project” they are referring to a stand-alone class that is able to run a unit test.

    EDIT2:
    You shouldn’t need more than one manifest.
    Include any test activities in the manifest with the following:

    <uses-library android:name="android.test.runner" />  
    
    <instrumentation android:label="All Tests"
        android:name="com.App.Data.Tests.MyInstrumentationTestRunner"
        android:targetPackage="com.App.UI" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using the following guide for getting started with rails for ubuntu 9.10. http://guides.rails.info/getting_started.html
From this example http://www.smartclient.com/smartgwt/showcase/#tree_databinding_local , I started to implement my own tree structure dynamically
Whe I try to run my site locally I get this error: Description: The
I'm trying to get started with South data migrations. I found this SO question:
After reading this description of late static binding (LSB) I see pretty clearly what
I have something like this: [Description(Sets the color.), Category(Values), DefaultValue(Color.White), Browsable(true)] public Color MyColor
How to describe this in description logic? every human is either male or female
I have a query which produces a list of orders like this: Invoice Description
I have a lot of C# VS2008 code that looks like this: new SqlParameter(@Description,
FYI, There is some overlap in the initial description of this question with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.