Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Kangaroo Rewards
PLUS
Kangaroo Rewards
Courses Plus Student 5,699 Points

Assets for tablets

I want to start creating an Android App only for Tablets, but my concerns are:

  • How can I create the assets to fit well in all tablets (7' and 10')? Are there any tools?
  • The minSdkVersion is 17. What will be the right way to start? Do I need to create many layouts for different inches: layout-sw600dp and layout-sw720, etc? or Can I create only one layout and save it in layout-sw600dp?

Thanks in advance for your help

2 Answers

J.D. Sandifer
J.D. Sandifer
18,813 Points

I think this largely depends on your app:

  • I have several apps that don't need multiple layouts because they only have a few controls, etc. on each page. Good use of the layout keeps everything spaced nicely on all sizes and nothing gets too small.

  • If you have a ton of stuff on some pages, you might consider different layouts for different sizes.

Daniel Hartin
Daniel Hartin
18,106 Points

Hi

I'm with J.D.Sandifer here, I would aim for designing the layout based on an 8" tablet (or somewhere in the middle). With android as it uses XML for creating and defining your layouts you need not worry too much about your assets. I generally go for a higher resolution image than required so it looks good on larger devices and let android handle the scale down (you do need to offset this against performance and memory overflow problems however). If there is going to be a large difference and you get performance or memory problems try using different resolution images.

I usually use percentage based layout parameters to avoid these resolution problems (i.e. using layout_weight and weightSum in linear layouts and in relative layouts anchoring middle sections to top and bottom of other sections to stretch the middle out).

The main reason I find myself opting for multiple layouts is for making use of all the available space while still looking good! this is where fragments really come into their own.

Daniel