How to set up ( Fedora php ruby on rails )

Monday, January 2, 2012

Android: How to include classes from other project from command line

How to add reference to an other android project(ANT)

Often we need to refer classes from other projects using eclipse is kinda easy and google will help you a lot in doing that, but here I am going to show how to include classed or refer other android project libs in your project

Suppose you have project one with a class Student with attribute name along with setter and getter and want to import Student class in second project, First you need to update project second to tell where to load files that can be done by
android update project --path ./ --library ./../SecondProject
if you debug your code now you probably will get exception because (probably) project one is not a library project. so you need to go to first project and update project.properties file and add android.library=true after target=your target
now compile the project all will go well.

Now you want to use the Student class from package one (com.package.one) is package name then you can use import com.package.one.Student;