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: