if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
// Do something for Lollipop and above versions
canvas.drawOval(left, top, right, bottom, mBoxPaint);
} else{
// do something for phones running an SDK before Lollipop
RectF mRectF = new RectF(left,top,right,bottom);
canvas.drawOval(mRectF, mBoxPaint);
}