user818502
user818502

Reputation: 711

Scaling Android Apps up For Tablets

I currently have an android application created using android 4.0. I originally developed it for a phone screen size but decided I wanted to try it out on my real life tablet. The problem is (which most of you probably already know) is that all the textviews and buttons remain small because it's ment for a phone. I was talking to a professor of mine and she had mentioned a one line piece of code that goes into the xml manifest which will automatically scale up everything for me. Searching around the only thing I found that seemed the simplest to implement was this:

<supports-screens android:largeScreens="true" />

When I added in this code it didn't see to make a difference. I even tried the xlragescreens just in case.

Am I doing something wrong or is there really an easy way to make my apps scale up easily or do i have to make a tablet version?

Also a few quick points that may help: The tablet is: nexus 7 (running 4.1) I do have the targetSdkVersion set at 15 (looking on the net I saw that you need to set it above 11 for scaling).

Thanks!

Upvotes: 1

Views: 1544

Answers (1)

James McCracken
James McCracken

Reputation: 15766

Create a /res/layout-large folder and name the XML file the same as the one you are already using in /res/layout. This layout will then be used when loaded on large screens like tablets. Also, it is best practice to use match_parent and wrap_content to size your UI elements and not define them using px or dp.

For more info on creating a UI for all displays go here:

http://developer.android.com/guide/practices/tablets-and-handsets.html

Upvotes: 1

Related Questions