how to use a project as a library api in another project in android?
<p>I have a splitview project using fragment in android, where i used some method to generateviews, define width of the splits and a method to set the background colour, here is my java code:</p>

<pre><code>public class SplitviewActivity extends FragmentActivity implements
        Left.OnButtonClickListener {

    LinearLayout LEFT, RIGHT, leftfragmentln, rightfragmentln;
    Right rightFr;
    Left leftFr;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //reduced the Gray Bar
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);


        setContentView(R.layout.main);
        // initializes the objects
        initializer();

        // sets the size of the two sides, give the ration here
        setSize(20, 80);
        // sets the colour of the two sides
        setColor(Color.BLUE, Color.RED);

    }

    public void initializer() {
        LEFT = (LinearLayout) findViewById(R.id.lnLeft);
        RIGHT = (LinearLayout) findViewById(R.id.lnRight);
        leftfragmentln = (LinearLayout) findViewById(R.id.lnLeftFragment);
        rightfragmentln = (LinearLayout) findViewById(R.id.lnRightFragment);
        rightFr = (Right) getSupportFragmentManager().findFragmentById(
                R.id.view_right);
        leftFr = (Left) getSupportFragmentManager().findFragmentById(
                R.id.view_left);

    }

    public void setColor(int leftColor, int rightColor) {

        // for landscape mode
        if ((rightFr != null) &amp;&amp; rightFr.isInLayout() &amp;&amp; (leftFr != null)
                &amp;&amp; leftFr.isInLayout()) {

            LEFT.setBackgroundColor(leftColor);
            RIGHT.setBackgroundColor(rightColor);
        } else {
            // for portrait mode
            RIGHT.setBackgroundColor(rightColor);

        }

    }

    public void setSize(float leftsize, float rightsize) {

        // for landscape mode
        if ((rightFr != null) &amp;&amp; rightFr.isInLayout() &amp;&amp; (leftFr != null)
                &amp;&amp; leftFr.isInLayout()) {

            android.widget.LinearLayout.LayoutParams par1 = (LayoutParams) LEFT
                    .getLayoutParams();

            android.widget.LinearLayout.LayoutParams par2 = (LayoutParams) RIGHT
                    .getLayoutParams();
            par1.weight = rightsize;
            par2.weight = leftsize;

        }

    }

    // a method to add view in a blank xml programatically
    public void setView(View leftView, View rightView) {
        if ((rightFr != null) &amp;&amp; rightFr.isInLayout() &amp;&amp; (leftFr != null)
                &amp;&amp; leftFr.isInLayout()) {
            leftfragmentln.addView(leftView);
            rightfragmentln.addView(rightView);
        } else {

            rightfragmentln.addView(rightView);

        }
    }

    @Override
    public void onClickButton(String s) {

        if ((rightFr != null) &amp;&amp; rightFr.isInLayout()) {
            rightFr.setText(s);
        } else {
            Intent intent = new Intent(this, RightActivity.class);
            intent.putExtra("value", s);
            startActivity(intent);
        }

    }
}
</code></pre>

<p>now I want to use this code as a library in another project and just want to call these methods to generate views, define width and setbackground colour. I have tried in different ways, but nothing was able to solve my problem. Can any one help me with a simple example?</p>
