Android - Drawing

Objective #1: Understand how to upload a normal picture into a program

android:background="@drawable/nameofpicture(without.png)"

Objective #2: Understand how to change colors in xml format

 android:background="#hexadecimal code"

android:textColor="#000

Objective #3: Understand how to change colors in code

TextView x = new TextView(this);       
x.setText("BLUE");
x.setTextColor(Color.BLUE);      
setContentView(x);

Objective #4: Understand how to use the onDraw method

public class DrawView extends Activity
{
      DemoView demoview;
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
            super.onCreate(savedInstanceState);
            demoview = new DemoView(this);
            setContentView(demoview);
      }

      private class DemoView extends View
      {
            public DemoView(Context context)
            {
                  super(context);
            }

            @Override protected void onDraw(Canvas canvas)
            {
                  super.onDraw(canvas);

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

canvas.drawRect(100, 160, 220, 280, paint);

canvas.drawLine(100, 160, 220, 280, paint);