I'm not native speaker.
In order to achieve your purpose you need to follow these steps:
1. Find the dimensions of your device: I did this some time ago, here you have my implementation.
protected void loadDeviceDimensions(){
Point size = new Point();//Calcular Width y Height.
WindowManager w = getWindowManager();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2)
{
w.getDefaultDisplay().getSize(size);
DeviceWidth = size.x;
DeviceHeight = size.y;
}
else
{
Display d = w.getDefaultDisplay();
DeviceWidth = d.getWidth();
DeviceHeight = d.getHeight();
}
}
- Once you have the device dimensions the next step is create the text fields, the text, font, and all the other stuffs. Don't worry about the position, just create the fields
- Once you have your fields created with their text and font set, its time to set their position. For these purpose you will need to use the TextView.getWidth() and TextView.getHeight(). The code should look like this.
for(int i=0, i < textView-1 , i++) {
if( textViews[i].getWidth <= deviceWidth/2 && textViews[i+1].getWidth <= deviceWidth/2){
//Put the two text fields on the same line
i++;//Don't forget this line.
}else{
//Put only one text field on the line.
}
}