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
139
votes
5 answers

How to prevent screen lock on my application with swift on iOS

How can I prevent screen lock only when using Navigation? Waze has the option to do that, how can I do this in my App?
alvarogalia
  • 1,601
  • 2
  • 12
  • 10
133
votes
7 answers

How to check an Android device is HDPI screen or MDPI screen?

I want to check this to fetch different images by internet. How to do that?
virsir
  • 15,159
  • 25
  • 75
  • 109
120
votes
12 answers

Flutter: Move to a new screen without providing navigate back to previous screen

I'm implementing an authentication flow in my Flutter app. After a sign in attempt, the CheckAuth (which checks whether a user is signed in or not and then opens home screen or sign up screen accordingly) is opened with this code: void _signIn()…
Darkhan
  • 2,888
  • 5
  • 20
  • 30
118
votes
4 answers

Android screen size HDPI, LDPI, MDPI

I have a background that I need fit in all screen sizes. I have three folders, hdpi, ldpi and mdpi for drawables, but in the emulator there isn't any referense to what resolution hdpi is and what mdpi and ldpi are.
artouiros
  • 3,947
  • 12
  • 41
  • 54
115
votes
9 answers

What's dp (density independent pixels) units with CSS?

For Android, people recommend using dp (density independent pixels) measurements for UI elements, and there are conventions that exist such as using 48dp for a button height, etc. I'm working on a web application, and I'm getting a lot of criticism…
Brad
  • 10,015
  • 17
  • 54
  • 77
112
votes
16 answers

How to get the size of the current screen in WPF?

I know I can get the size of the primary screen by using System.Windows.SystemParameters.PrimaryScreenWidth; System.Windows.SystemParameters.PrimaryScreenHeight; But how do I get the size of the current screen? (Multi-Screen users do not always use…
Nils
  • 9,682
  • 6
  • 46
  • 72
97
votes
2 answers

Application Skeleton to support multiple screens

As we know Android coming with various device which having different Features, Resolution, and Screen-size so while developing an Application which support multiple (small and big) screen there is an obstacle of size and layout. This leads to…
Mohammed Azharuddin Shaikh
  • 41,633
  • 14
  • 96
  • 115
96
votes
13 answers

Detect 7 inch and 10 inch tablet programmatically

Is there a way to programmatically find whether the device the app is installed on is a 7 inch tablet or a 10 inch tablet?
Rookie
  • 8,660
  • 17
  • 58
  • 91
82
votes
1 answer

How can I prevent the display on an iOS device from dimming and turning off?

I'm diving into iOS development and am building my own alarm clock app to become familiar with platform and SDK. I've noticed some alarm clock apps in the app store keep the screen from dimming and/or turning off when their app is running. How is…
BeachRunnerFred
  • 18,070
  • 35
  • 139
  • 238
81
votes
8 answers

Get and Set Screen Resolution

How can I collect and change screen resolution using Visual C#?
Bruce Powell III
  • 811
  • 1
  • 6
  • 3
81
votes
11 answers

C#: Get complete desktop size?

How do I find out the size of the entire desktop? Not the "working area" and not the "screen resolution", both of which refer to only one screen. I want to find out the total width and height of the virtual desktop of which each monitor is showing…
Timwi
  • 65,159
  • 33
  • 165
  • 230
73
votes
6 answers

Android accelerometer not working when screen is turned off

I'm developing an application for my final thesis on computer science, and I need to collect and log accelerometer data. I need to acquire it for a whole day long, so there are serious battery constraints (for instance, I cannot leave the screen…
martin
  • 1,631
  • 1
  • 13
  • 15
73
votes
2 answers

android: broadcast receiver for screen on and screen off

I was just wondering if it is possible to register a broadcast receiver that detects Screen ON/OFF in the application manifest. The reason why I don't like the programmable method is that it requires the app to be running in order to detect such a…
himura
  • 1,555
  • 3
  • 19
  • 30
73
votes
4 answers

getLocationOnScreen() vs getLocationInWindow()

What is the difference between screen and view in the context of these two methods? I have a button and I want to get the x coordinate of its center. I guess this would be enough: public int getButtonXPosition() { return…
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
70
votes
17 answers

How to avoid restarting activity when orientation changes on Android

I am creating an Android app in which I'm drawing a view on a canvas. When the device's orientation changes, the activity restarts. I don't want it to. How can I avoid restarting the activity when the orientation changes?
chirag
  • 701
  • 1
  • 5
  • 3