Wednesday, April 13, 2011

How to create android applications for tablets?

By Magesh Kumar   Posted at  10:58 PM   Android 1 comment


With the new 2.3 SDK, we get the opportunity to develop android for tablets. (At least, with the Galaxy Tab Addon).
When starting a new tablet emulator, first we need to set the "Scale display to real size" option. This helps to set the tablet's size, to our screen size. In my case, it's 1440x900px.
tablet
If we run a simple 1.6 project (we need at least API level 4, SDK 1.6 for tablets) on a tablet emulator, we will get the following:
tablet
Our application doesn't fill the tablet's screen, we need to solve that!
First, open the AndroidManifest.xml file. Add this lines:
  1. <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="9"/>
  2. <supports-screens android:anyDensity="true" />
Now the application does fit the screen!
tablet
To develop apps for tablet and normal phones too, you need to create the 2 tablet resource folder under /res. Make drawable-large and layout-large folders, and put the tablet's graphics/ui there!
Of course, you need to create layout-large-land folder, for the tablet's landscape screen!
tablet

About the Author

Nulla sagittis convallis arcu. Sed sed nunc. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.
View all posts by: BT9

1 comment:

Back to top ↑
Connect with Us

What they says

© 2013 MaGeSH 2 help. WP Mythemeshop Converted by BloggerTheme9
Blogger templates. Proudly Powered by Blogger.