I am fairly new to java and android. at the moment i am studying java at school. i just started working in this calculator just to get my hand in android developing. my problem at the moment is that when i deploy the app to the emulator (phone size 480×800) looks like Pic 001, but when i deploy it to my Kindle fire 1st gen (1024×600 i believe) looks like Pic 002. how can i make it so it look the same in every phone.


In order to have your buttons fill the entire width of your screen, put this in your tags
Button:instead of :
If you want the buttons to be higher :
– In your tags
Buttonchangeandroid:layout_height="80dp"toandroid:layout_height="match_parent".– In your tags
LinearLayoutwhich contain your buttons changeandroid:layout_height="wrap_content"toandroid:layout_height="0dp" android:layout_weight="1".– In your tag
TextViewchangeandroid:layout_height="wrap_content"toandroid:layout_height="0dp" android:layout_weight="X"where X is the value that gives you the right proportions.You will have a warning telling your that nested weight are bad for performance but it’s the only way I know to do this.
In general, if you want a component to fill the empty space, set the width or height to 0dp and add a weight. The weight will define the proportions of the elements which want to fill the space.
I hope it will help you.