I am new to Android. I am building my first application.
I have been trying to make it support multiple screens. I have gone through the developers section in androi
When you inflate your layout or setting your content view you can try making method on your application if you have base activities or base fragments
//At base activity/fragment
protected boolean isLargeLayout() {
return getResources().getBoolean(R.bool.large_layout);
}
//Then at your real activity/fragment just call
if(isLargeLayout()) {
//Set your layout knowing it's large
}else{
//Normal layout
}
Or use straight something like
if(getResources().getBoolean(R.bool.large_layout)) {
}
Or use dimens.xml with different dps (I do not prefer this method. I like android to choose which is large screen or not)
You have to write layout once but have to define dimensions dimens.xml for different different resolutions in app>res>values.