As we all know, when the Android 2.3 (Gingerbread) SDK was released, a third-party add-ons was added to the SDK, including the Galaxy Tab Addon for tablets.
When we launch a new tablet simulator, first we need to set the "scale display to real size" option, which will allow the tablet screen size to match the size of our computer screen. Take My computer as an example, my screen size is 1440x900px.
If we run an example of SDK 1.6 on our 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 emulator, and we will solve the problem below.
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 filled with the entire screen, as shown in:
As with developing applications for tablets and developing applications for mobile phones, we need to create two resource file directories in the/res directory, create Drawable-large and Layout-large directories, and put all the picture resources and UI files inside. Of course, you will also need to create a Layout-large-land directory for the Flat screen tablet program. The entire application structure looks like this:
Android <supports-sceeens> usage, adapts to screen size