release android test project in eclipse

249 Views Asked by At

Hi I'm working on an android app in eclipse. I create the android project with the test project. I worked on the android test. Now the main project folder haven't classes and files. There is only the manifest. How can release and convert the test project into the main project?

I created a new android application in eclipse called Volume control. Automatically eclipse created a second project called Volume controlTest. I worked on the second one. I tested it and it works fine. Now I want to publish it. How can I transfer the files on the Volume control project? If I refactor and change the name to the folder or the package I lost the project. If I delete the Volume control folder eclipse said me that it need the Volume control project to run Volume controlTest.

I need the source code well written to publish it on GIT and make the app open.

help me please!

2

There are 2 best solutions below

0
On

It sounds like you wrote your Android app within the test project rather than within the main project.

Eclipse creates two projects, the main project and the test project, which has the name "Test" appended to whatever name you specified. The test project is intended to hold tests that you write for testing the main code.

Instead, you should write your code in the main project, and the tests in the test project.

Since you put your app code in the test project by mistake, you should be able to copy it into the main project via the operating system's native file management and Eclipse should pick up the changes. You may have to fix a few things up like paths, class names and the like, but you shouldn't lose any work.

0
On

Solved:

  1. save the test project into a folder outside the eclipse workspace
  2. remove the project from eclipse
  3. create new empty "Android Project" without activities
  4. copy and paste project files from the file manager to eclipse
  5. remove all the words ".test" from the project files.
  6. into the manifest remove <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="....." /> and <uses-library android:name="android.test.runner" />

VERY IMPORTANT!!!! Do not save until you have made all changes otherwise eclipse change the project and you need the test project to use the main project