Reputation: 351
Android studio 1.3.1 has many devices and sizes for phones and tablets. should I design layout for all the devices in android studio1.3.1? Please see the following image and consider there are not questions about my question.
1- which folders I should create really for supporting a layout in all devices?
2- If I used a @+id/button
for a button in a activity_main
layout, should I use the same @+id/button
for the same activity_main
layout in other folder for supporting?
Upvotes: 3
Views: 96
Reputation: 1140
Check out this course on Udacity made by Google if you want more tips: Android Design for Developers Especially lesson 5 about adaptive design.
Upvotes: 1
Reputation: 6305
For the first Question:
No. You don't have to make a layout for every device configuration and most of it will handled by android if you use "dp" for all views and widgets and "sp" for fonts but if the layout is not shown correctly in some devices, you just have to alter layout for those device configs.
Here is some of the best practices for android layout compatibility:
always define views dimensions in dimens.xml
always use "dp" for defining views size and "sp" for font size
always first try solve layout incompatibility by defining new config for dimens.xml unless the design need to be changed then use new config for layout
also google have good documentation about this : Supporting Multiple Screens
Second Question: Yes. you should define the widget again in new layout.
Upvotes: 2