Android & lt; supports-sceeens & gt;

Source: Internet
Author: User

Android <supports-sceeens>

We all know that when the Android 2.3 (ginger pie) SDK was released, a third-party add-ons was added to the SDK, including the Galaxy Tab Addon for tablets.

When we start a new tablet simulator, we first need to set the "Scale display to real size" option, this will match the screen size of the tablet with the screen size of our computer. Taking my computer as an example, my screen size is 1440x900px.


If we run an SDK 1.6 example on a tablet simulator (we need at least API level 4, SDK 1.6 for tablets), you will see the following:

Our application does not fill the screen of the entire tablet simulator. let's solve this problem.

First open the AndroidManifest. xml file and add the following code:

<Manifest xmlns: android = "http://schemas.android.com/apk/res/android"
Package = "com. niuren. test. main"
Android: versionCode = "5"
Android: versionName = "1.3.1">

<Supports-screens
Android: smallScreens = "true"
Android: normalScreens = "true"
Android: largeScreens = "true"
Android: anyDensity = "true"
/>

Now our program is full of the entire screen, as shown in:

Developing applications for tablets is the same as developing applications for mobile phones. We need to create two resource file directories under the/res directory to create the drawable-large and layout-large directories, put all the image resources and UI files in it. Of course, you also need to create a layout-large-land directory for the horizontal screen tablet program. Shows the entire application structure:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.