[android] center a drawText

For y :

int yPos = (int) ((canvas.getHeight() / 2) – ((paint.descent() + paint.ascent()) / 2)) ; //((textPaint.descent() + textPaint.ascent()) / 2) is the distance from the baseline to the center.

For x :

http://stackoverflow.com/questions/4909367/how-to-align-text-vertically