title: how to move an image along circle in android?
body: <p>I want to move my ball image in a circle or 360 degree, I have tried but it only draws ball image on canvas and not rotating in circle. </p>
  
  <p>Can you please suggest feasible solution or give me some type of source code that can help me to move object in circle.</p>
  
  <pre><code> protected void onDraw(Canvas canvas) {
  
      // TODO Auto-generated method stub
      super.onDraw(canvas);
      canvas.drawColor(Color.WHITE);
  
      int cx = getWidth() / 2;
      int cy = getHeight() / 2;
  
      float angle = 5;
      float radius = 150;
      float x = (float) (cx + Math.cos(angle * Math.PI / 180F) * radius);
      float y = (float) (cy + Math.sin(angle * Math.PI / 180F) * radius);
      canvas.drawBitmap(ball, x, y, null);
      if (angle &lt; 360) {
  
          angle += 5;
      }
  
      invalidate();
  
  }
  </code></pre>