Questions tagged [android-screen-support]

The foundation of Android's support for multiple screens is its ability to manage the rendering of an application's layout and bitmap drawables in an appropriate way for the current screen configuration.

445 questions
321
votes
10 answers

How to determine device screen size category (small, normal, large, xlarge) using code?

Is there any way to determine the category of screen size of the current device, such as small, normal, large, xlarge? Not the density, but the screen size.
vieux
  • 23,887
  • 3
  • 26
  • 26
162
votes
10 answers

How to define dimens.xml for every different screen size in android?

When supporting different screen sizes (densities) in Android often the focus is on creating different layouts for every possible screen. I.E. ldpi mdpi hdpi xhdpi xxhdpi xxxhdpi I designed a layout for an xhdpi screen as a reference, and defined…
Amit Pal
  • 10,604
  • 26
  • 80
  • 160
88
votes
4 answers

About Android image and asset sizes

I need to clarify some doubt about the image assets for my app, if I specify in an xml file that the height of something [image view] is 50 dip height which type of screen should i choose from the resources folder? drawable, hdpi, ldpi, mdpi,…
77
votes
2 answers

Scale factor for xxhdpi android?

according to http://developer.android.com/training/multiscreen/screendensities.html The following scale factors are mentioned xhdpi: 2.0 hdpi: 1.5 mdpi: 1.0 (baseline) ldpi: 0.75 I was wondering what the scale factor would be for xxhdpi?
Muhammad Ahmed AbuTalib
  • 4,080
  • 4
  • 36
  • 59
61
votes
4 answers

Do I need 14 different layouts to support all Android devices?

I'm really feeling confused. From the docs at developer.android.com, it seems in order to keep my images scaled correctly (aspect ratio too) across all current Android devices I need all these layouts below. Is that really what everyone is doing? …
wufoo
  • 13,571
  • 12
  • 53
  • 78
38
votes
2 answers

Android resource selection layout- and values- inconsistencies

The issue I am experiencing indicates that the resource bucket being selected for a given activity's layout XML is inconsistent with the resources being selected from the values folder despite the exact same resource qualifiers being used in each…
30
votes
5 answers

How to know smallest width (sw) of an android device?

I have 4 different devices: Asus tablet, screensize 7" Lenovo tablet, screensize 7" HTC mobile phone, screensize 5" HTC mobile phone, screensize 4.7" I want to know the smallest width (sw) of my device to make a support layout for it. I want to…
user2955394
  • 1,063
  • 4
  • 17
  • 34
29
votes
7 answers

How to prevent automatic screen lock on android by code?

In my app there is a long loading process, and if the devices puts on the screen lock, my process stops for some reason. How can i prevent the device from automatic screen lock?
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
27
votes
4 answers

Android: Disable application for tablet

I developed an application, Now i want to restrict the application for tablet. Means the application should not run on any tablets. For that I specify the support-screens in Androidmenifest.XML file as:
26
votes
3 answers

Where does android.max_aspect meta make difference?

A recent blog explains that we must use in element of AndroidManifest.xml for optimal display on super widescreen devices, e.g. Samsung Galaxy S8. To test this, I…
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
26
votes
3 answers

Setting drawable folder to use for different resolutions

I have 4 different sizes for each of the icons I need to use in my app. The problem is My Nexus 7 (1280 x 800) and galaxy s2 (800 x 480) seem to use the resources in drawable-hdpi. How do I force the Nexus to use resources in drawable-xhdpi and then…
21
votes
4 answers

How to restrict app to Android phones only

Hello I am targeting users to Android phones only. I want to restrict the app to install on Android phones ony not on phablets and tablets. What are the configuration do I need to apply in AndroidManifest.xml so that Google Play app wont show the…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
14
votes
4 answers

Explain the difference between drawable, drawable-ldpi, drawable-mdpi and drawable-hdpi

I have a rough idea of what each of these directories are for, but I'm not really clear on the concept and I have some specific questions. For example, what are the target DPIs for each directory? When you create an asset, should it be at that…
Steve Prentice
  • 23,230
  • 11
  • 54
  • 55
14
votes
2 answers

Get text content of the android screen

Is there any way to get the text content that is being displayed on the android mobile screen. It may be by any android app. for example in the image linked above, i wish to get all the text (starting from the "Larry Page" till the end "Fred Smith"…
zeekhuge
  • 1,594
  • 1
  • 13
  • 23
13
votes
4 answers

Android handling multiple screens... (Relative Layout or Linear Layout)?

I have finished my application and now need to handle adapting to multiple screen sizes. At this point it seems my only option is to do the following: Have a seperate xml layout for: Small, Normal, Large and X-Large screen sizes. Have a seperate xml…
droider
  • 302
  • 1
  • 3
  • 11
1
2 3
29 30