My question is, how to make your layout resize according to the screen resolution of the device you're working on? For example: when I run my app on my phone the layout fits perfectly, but when I run it on my tablet, the layout has the same size as on my phone with a load of white space around it. How can I solve this?
Try using view dimensions in terms like (100%x) and (100%y). If you had a panel of a width of 100%x it would be displayed as the exact width of the screen no matter what device you were running on and for height 100%y would do the same. For detecting device orientation if the current width (i.e If Activity.width > Activity.height) then you are in Landscape mode, otherwise you would be in Portrait mode. This subject has been discussed many times here on the forum as well as the Beginner's and User's Guides available as a free download. If you search around you will get even more answers to your question.