title: Android ontouch example
body: <p>I have an example which I collect from Internet.     </p>
  
  <pre><code>public class MprojectActivity extends Activity {
      /** Called when the activity is first created. */
      ImageView itan2;
  
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
  
          itan2=(ImageView)findViewById(R.id.imageView18);
  
          itan2.setOnTouchListener( new OnTouchListener() {
  
              @Override
              public boolean onTouch(View v, MotionEvent event) {
                  // TODO Auto-generated method stub
  
  
             if(event.getAction()==MotionEvent.ACTION_MOVE){
  
                 RelativeLayout.LayoutParams mParams = (RelativeLayout.LayoutParams) itan2.getLayoutParams();
  
                      int x =(int)  event.getRawX();
                      int y =(int)  event.getRawY();
  
                      mParams.leftMargin =  x-236;
                      mParams.topMargin =  y-565;
                      itan2.setLayoutParams(mParams);
  
  
             }      
                  return true;
              }
          });
  
                    }
  
  } 
  </code></pre>
  
  <p>In this example I subtract 236 and 565 with x and y.What are these values actually.how to find them with dynamic coding?</p>