how to work with different resolution in android? - android

I have to prepare one application.I want give support to different resolution.i have to prepared different layouts.Frist time my layouts is,
res/layout/mylayout----7" normal screen
res/layout-large/mylayout----7" large screen
res/layout-xlarge/mylayout---10.1"
but it is taking 7" large screen.i found some solution in this site.Solution is ,create layout is,
res/layout/mylayout----7" normal screen
res/layout-sw600dp/mylayout----7" large screen
res/layout-sw720/mylayout---10.1"
After changed layout names it is taking 7" large screen only. please help me do.

Check your project Build Target To support xlarge screen your project build target should be atleast android 2.3.3 adk.
In Eclipse -?right click on project -> Properties -> Android -> Select Project Build Tagrget as 2.3.3 or onwards.
First of all set the multiple screen support in your Android Application manifest file
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
And also see this Link

For mulitple screen support Try by using this... in ur android manifest file
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
/>

Related

Android how to choose different dimension problems

I am new android and i have a question. I am developing a app, and i see this problem. I create layout for Pixel 2 and other devices cant show as Pixel 2. When i research, i learning create layout every dimension.
I added this on AndroidManifest.xml
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:normalScreens="true"
android:anyDensity="true"/>
And created different layout; example login_activity.xml (normal) and login_activity.xml (large). But how choose device this screen, is it automatic or other way?
https://github.com/intuit/sdp use this for support layout in multiple screen size.

My Android Studio keeps ignoring Large Layout and picks Normal for ALL screens

I'm using the Layout Variants tool to create differents sizes for my layout.
the problem is that when i pick any large Device to preview my layout..
it keeps using the normal size
how can i force it to pick the right layout for the screen ?
by the way i already did the AndroidManifest support screens
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
but still having problems!
also my app icon looks so small too in my phone!
any idea?

Create Android App Support for tablets

I want to create app for support different sizes of tablets, I added this for my Manifest
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
But my app design does not fit for different device screens, I used Android Studio 2.2.2
You need to have several dimen.xml files in values folders such as values-sw600dp, values-sw720dp, values-sw800dp. Next, update values in dimen.xml files(increase or reduce values of dimen items)

Android layout qualifier does't work

Problem:When I tested my program on different size Android phones, the layout were not selected correctly.
I used setContentView(R.layout.activity_home) to set the layout.
In the res/ directory, I created
res/layout/activity_home.xml
res/layout-sw320dp/activity_home.xml
res/layout-sw480dp/activity_home.xml
res/layout-sw720dp/activity_home.xml
In the AndroidManifest.xml
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:anyDensity="true"
/>
Then I tested it seperately on 320x480,480x800,720x1280 emulators. All these devices selected the layout /res/layout-sw320dp/activity_home.xml.
The target platform I set is 4.4.2 and the emulator's version is 4.3.3.
I have no idea why this happened..
http://developer.android.com/guide/practices/screens_support.html
and
/ here
here
use this link and use the directory structure to support multiple screens
Hope it may help u

How to enable layouts for multiple(different sizes of) screen in ANDROID?

I'm new to android
I want to run the android application in different screen sizes
Created
res/layout/layout.xml
/res/layout-small/layout.xml
/res/layout-large/layout.xml
/res/layout-xlarge/layout.xml
four types of layout in my application
After this what I want to do
Can any one say with example .Is there any other change want to make it in code
Thanks in advance
use following ,
for small screen
res/layout/layout.xml
/res/layout-land/layout.xml
for large screen like tablets you can use,,
/res/layout-large-hdpi/layout.xml
/res/layout-land-large-hdpi/layout.xml
these two representations are enough and it can fit to all devices
layout-land is for landscape mode for smaller devices and layout-land-large-hdpi for large devices,
and add these lines to your manifest.xml
<supports-screens android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
Add This code in XML file before compiling the app
<supports-screens android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />

Categories

Resources