Setting Exact button size in mm

I’m trying to setup a UI for an application to run on an Android phone for a research experiment.

I want to control the exact size of the buttons on the screen (down to mm).

I do not want scaling and I am not worried about supporting multiple devices.

Is there a way to do this so that I can precisely control the size of a button?