I want to Create an application that support on Both mobile and tablet version of android devices.I like to Upload one apk file to android market to achieve that.
it will works as follows.
How can I do that.Correct me If I am wrong.
Regards, Kariyachan
There are several ways doing that.
First you can create different values folders. Each folder may have dimensions which are used for several sizes.
Second attempt is creating different layouts. There is a good cheatsheet for the different foldernames:
http://petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/
Then you can add several drawable files for different screensizes.
Another helpfull way is using fragments. For example, a phone will have 2 activities with a list and a content while a tablet have just one which display a list, and the content.
You can see all possible folders at http://developer.android.com/guide/practices/screens_support.html
Another way is creating several defining which devices (resolution) may use your app.
You can define it within the manifest:
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
or
<supports-screens android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="600" />
Here's a good sample using fragments:
http://developer.android.com/guide/components/fragments.html
All possible folder definitions are listed below at
http://developer.android.com/guide/topics/resources/providing-resources.html
for example:
layout-sw320p
values-h720dp (screen must be higher then 720dp)
And then create a dimension file which have different resolutions, colors, whatever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With