PART 2: Creating Content with Java with Android Studio (Programming required)
With Simple Recipes
While you can easily set units of measurement in an XML file, you can also use Java to set units of measurement.
Every view or widget has a layoutParams object that has the layout parameters (e.g., height, width)
EXAMPLE: Set Object Height
Button showDialog = (Button)findViewById(R.id.showDialogID);
showDialog.getLayoutParams().height = 100;
This will set the height of the showDialog button to 100 pixels. It is best to use dp unit of measurement instead. To do this