Swype Keyboard implementation
<p>My Activity contains three Buttons and I set the onTouchListener for them. If I touch on any button and move I should be able to get the text of the buttons on which I moved.Also I should draw a continuous line following the Touch Events.I am able to trace the path but failing to draw the path.
I am presenting the following code I implemented. Please let me know what I am missing to complete the task. If possible explain with code.</p>

<pre><code>public class MyActivity extends Activity {
private Button btn1,btn2,btn3;
private EditText editText;
private float x1,y1,x2,y2;

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

btn1=(Button)findViewById(R.id.button1);
btn2=(Button)findViewById(R.id.button2);
btn3=(Button)findViewById(R.id.button3);
editText=(EditText)findViewById(R.id.editText1);

btn1.setOnTouchListener(myTouchListener);
btn2.setOnTouchListener(myTouchListener);
btn3.setOnTouchListener(myTouchListener);
}
public boolean OnTouch(View view,MotionEvent event){
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
x1=view.getX();
y1=view.getY();
break;
case MotionEvent.ACTION_MOVE:
x2=view.getX();
y2=view.getY();
canvas.drawLine(x1,y1,x2,y2,paint);
x1=x2;
y1=y2;
break;
case MotionEvent.ACTION_UP:
x2=view.getX();
y2=view.getY();
canvas.drawLine(x1,y1,x2,y2);
break;
}
}// code ends
</code></pre>

<p>I know that I need to extend the View class and override the onDraw() method to draw line.
But I am unable to complete it. so please someone help me to finish it.
Please post the total code. Ur efforts towards the solution will be thanked!!</p>
