Java tutorial
//package com.java2s; import android.graphics.Canvas; public class Main { public static float getRadius(Canvas canvas) { float width = canvas.getWidth(); float height = canvas.getHeight(); float minSize = width > height ? height : width; float radius = minSize / 2; return radius; } }