Questions tagged [screen]

A screen on a device, such as an iPhone or other smartphone. For questions about GNU Screen (the terminal application for managing multiple windows), use the gnu-screen tag.

A screen on a device, such as an iPhone or another smartphone.

For questions about GNU Screen (the terminal application for managing multiple windows), use the tag.

4773 questions
69
votes
9 answers

Detecting when screen is locked

I've seen a couple of posts on here on how to check if the screen is locked, but none of it has been working for me. It all detects if the actual screen is off or not (not if it's locked). I have a game in which music plays. When the lock button is…
Ryan
  • 937
  • 1
  • 10
  • 17
68
votes
5 answers

Keep the screen awake throughout my activity

I have three activities in my app. I want to keep the screen awake when it is in the second activity. The screen should not go off in my second activity unless the "lock" key is pressed manually. I went through many links but they seem unclear to…
user838522
  • 3,821
  • 3
  • 23
  • 24
65
votes
3 answers

Xrandr errors. BadName (named color or font does not exist)

I was successfully using xrandr to extend my desktop in my work place with this little "script". #!/bin/sh xrandr --newmode 1920x1080 220.64 1920 2056 2264 2608 1080 1081 1084 1128 -HSync +Vsync xrandr --addmode VGA 1920x1080 xrandr --output…
Jlbelmonte
  • 1,246
  • 1
  • 11
  • 14
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
58
votes
5 answers

How do I determine which monitor my .NET Windows Forms program is running on?

I have a C# Windows application that I want to ensure will show up on a second monitor if the user moves it to one. I need to save the main form's size, location and window state - which I've already handled - but I also need to know which screen…
Stephen Fletcher
  • 689
  • 1
  • 8
  • 11
55
votes
7 answers

Is there a way to determine android physical screen height in cm or inches?

I need to know exactly how big the screen is on the device in real units of length so I can calculate the acceleration due to gravity in pixels per millisecond. Is there a method somewhere in the Android API for this?
Nathan
  • 6,095
  • 10
  • 45
  • 54
54
votes
9 answers

How to support different screen size in android

I'm developing an app in android and I have to support all different screen sizes and density. So i've created different folder for layout : layout-small layout-large and layout. Then I've created different folder for image: ldpi, mdpi and hdpi. In…
Jayyrus
  • 12,961
  • 41
  • 132
  • 214
52
votes
3 answers

Use screen.width inside calc (css)

Is there a was of using screen.width inside calc? Something like this: left: calc(250px + screen.width - 1024px)!important; It is for a concrete situation where the @media(max-width: 1024px) won't work.
Sefean
  • 591
  • 1
  • 7
  • 20
51
votes
8 answers

Determining if a form is completely off screen

I am developing an application that remembers the user's preferences as to where the form was last located on the screen. In some instances the user will have it on a secondary screen, and then fire the app up later without the second screen…
Cody
  • 3,734
  • 2
  • 24
  • 29
48
votes
18 answers

Magento How to debug blank white screen

I have an error in my Magento backend that results in a blank screen (WSOD). I have set errors to on in admin but there is nothing being created in var/logs/. (I have checked permissions for that directory and all is correct). I have also…
sulman
  • 2,431
  • 7
  • 40
  • 62
45
votes
3 answers

Difference between Wakelock and FLAG_KEEP_SCREEN_ON?

Keeping the screen awake can be accomplished by using a wakelock by mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, getClass().getName()); Or by adding the FLAG_KEEP_SCREEN_ON to the…
Ragunath Jawahar
  • 19,513
  • 22
  • 110
  • 155
44
votes
3 answers

Android activity image background size

I am a bit confused on creating an image which will be acting as a background for my activities. So, in short, my aim is that my application should be able to fit the different screen sizes. Therefore, what size in pixel should my three images be to…
Yash
  • 2,259
  • 4
  • 26
  • 33
43
votes
5 answers

Change Height based on Browser Size/Resize

I was wondering if there was a way to determine the height/width of a browser. What i'm trying to do is set a height on a div to 500px when the browser size is 1024x768, and for anything lower i'd like to set it to 400px.
AlteredConcept
  • 2,602
  • 7
  • 32
  • 36
43
votes
7 answers

Android: how to convert whole ImageView to Bitmap?

I have my application that is displaying images with different ratio, resized inside (centerInside) imageView. What I need is to create bitmap from the ImageView including the background (black in this case). So for example I have device screen…
yosh
  • 3,245
  • 7
  • 55
  • 84
38
votes
1 answer

Why does Google Chrome emulator show iPhone 6 at 375x667 resolution?

I'm trying to programmatically adapt my website's image sizes for differently sized devices. But now I am having trouble telling what sizes I actually need. In Google Chrome emulator, I'm seeing some of my images upsized, e.g. on iPhone 6 from…
Buttle Butkus
  • 9,206
  • 13
  • 79
  • 120