Within Eclipse, access Android Project classes from a Java Project

By : Gilbou
Source: Stackoverflow.com
Question!

How can I execute a block of code in an android project without having to launch the emulator.

I don't want to deal with the android lifcycle -> I want to test the logic of my app ONLY.

What I have in mind is to create another java project and define dependencies so that I can access the classes that are in my android project.

I would like to launch a kind of Main() method to bypass the emulator... Is it possible?

Thanks!

By : Gilbou


Answers

Look into unit testing. Fits your problem almost perfectly. Not exactly for a block of code but for methods.

There are special launchers such as JUnit that makes the test-running smother and much more fun. You get green and red lights for every test, great satisfaction to get all green. JUnit is fairly easy to get started with and is well integrated into eclipse.

By : Farmor


This video can help you solving your question :)
By: admin