title: How to apply the drag and drop in android 2.2 with out use surfaceview?
body: <p>hi i am new in android i use the android 2.2 api level-8.so i can use two image one for drag purpose and another for Drop purpose.
  Here i Display some my code which i can do here.
  Code Is which Display Device Height width and ball is my drag Image View.</p>
  
  <pre><code>windowwidth = getWindowManager().getDefaultDisplay().getWidth();
          windowheight = getWindowManager().getDefaultDisplay().getHeight();
          Log.e("Screen Width--&gt;", "" + windowwidth);
          Log.e("Screen Height--&gt;", "" + windowheight);
          ball = (ImageView) findViewById(R.id.secondImage);
          tempAnimationDrawable = (AnimationDrawable) ball.getDrawable();
          ball.setOnTouchListener(this);
  </code></pre>
  
  <p>Apply seton touch Listener on this.
  the on touchListener is below.</p>
  
  <pre><code>public boolean onTouch(View v, MotionEvent event) 
      {
          layoutParams = (RelativeLayout.LayoutParams) ball.getLayoutParams();
  
          switch (event.getAction()) 
          {       
          case MotionEvent.ACTION_DOWN:
              break;
  
          case MotionEvent.ACTION_MOVE:
  
              int imgWidth = ball.getWidth();
              Log.e("Image Width --&gt;", "" + imgWidth);
              int imgHeight = ball.getHeight();
              Log.e("Image Height --&gt;", "" + imgHeight);
  
              int x_cord = (int) event.getRawX();
              System.err.println("Display X code-&gt;" + x_cord);
              int y_cord = (int) event.getRawY();
              System.err.println("Display y code-&gt;" + y_cord);
  
  
              int getX=(int) event.getX();
              System.err.println("Display Here X Value --&gt;"+getX);            
              int getY=(int) event.getY();
              System.err.println("Display Here Y Value --&gt;"+getY);
  
              if (x_cord &lt; windowwidth &amp;&amp; getX &lt; imgWidth ) 
              {               
                  x_cord = windowwidth;
                  Log.e("If Part X Cord--&gt;", "" + x_cord);
              }
              if (y_cord &gt; windowheight) 
              {
                  y_cord = windowheight;
                  Log.e("If Part Y Cord--&gt;", "" + y_cord);
              }
              layoutParams.setMargins(imgWidth + incLeft, imgHeight + incTop, imgWidth + incRight, imgHeight + incBottom);
              // layoutParams.setMargins(left, top, right, bottom)
              ball.setLayoutParams(layoutParams);
              break;
  
          default:
              break;
  
          }
          return true;
      }
  </code></pre>
  
  <p>now i what to do.</p>