I know that i have to put this code in manifest
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
also i created different layout sizes and dimens:
layout-small
layout-normal
layout-large
layout-xlarge
Here is the confusion, the phone will pick automatically the screen size but there are different phone with screen sizes that pick same layout size. Let say layout-normal can take starting galaxy one and S up to galaxy 6 which have different screen size. In layout-normal is only one file but it will not fit all phones which takes layout-normal.
How to design and fix that layout that fixes every screen in layout-normal?
Related
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?
I created an Android app and tested it on Nexus6 Emulator. Everything seems fine on Nexus6 Emulator but when I ran that app on real devices (Samsung S6 and S5) the layout was all messed up. How can I fix this?
Do I have to create separate layout for each device?
Does Android have something like 1 layout for all screens?
I dragged and dropped all images in drawable folder instead of using "add image asset". There is nothing in hdpi, mdpi folder. All images are in drawable folder. Is this the cause of my issues?
Please advise.
It is all about the design of your xml. When designing your pages, try to use 'match parent' and ensure that you are making a layout that fits across all screen resolution. Look into AFAIK...
https://developer.android.com/training/multiscreen/screensizes.html
https://developer.android.com/training/multiscreen/screendensities.html
https://developer.android.com/guide/practices/screens_support.html
How to define dimens.xml for every different screen size in android?
For example:
In your xml
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
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)
Pleas can some one help me understand what values I should use to fit most android screen sizes.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.airrocketapps.macuser.airrocketapps">
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"
android:requiresSmallestWidthDp="320dp"
android:compatibleWidthLimitDp="320dp"
android:largestWidthLimitDp="320dp"/>
<application
Please have look at this article Android Layouts for different Screens
you have to made layout for every screen sizes if you want to handle all types of screen i,e landscape,potrait etc. You must use wrap_content or match_parent for views to fit into present screen or activity.
If you don't specify it will "support", as in launch on, any device with which the rest of the config is compatible. You can remove the support-screens tag completely. But there's a big difference between your layouts _fitting) on screen and them being appropriately designed for those screens.
Checkout Supporting Multiple Screens, Supporting Different Screen Sizes, and Designing for Multiple Screens in the Android docs.
when I run my android app on tablet in landscape mode the apps apears from right to left (as if it is portrait mode) not up to down, how to fix that?
you can find a snapshot here: http://i.stack.imgur.com/vpO9M.jpg
I am trying to make my app compatible with tablets I created the layout res for large screens and x large screens (layout-xlarge, layout-xlarge-land, layout-large and layout-large-land) and I added this to my androidManifest.xml file:
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
Try adding this within your activity, in your manifest.xml file
android:configChanges="orientation|keyboardHidden|screenSize|layoutDirection"