Questions tagged [screen-brightness]

130 questions
48
votes
16 answers

Change the System Brightness Programmatically

I want to change the system brightness programmatically. For that purpose I am using this code: WindowManager.LayoutParams lp = window.getAttributes(); lp.screenBrightness = (255); window.setAttributes(lp); because I heard that max value is…
Usman Riaz
  • 2,720
  • 6
  • 40
  • 64
38
votes
6 answers

changing screen brightness programmatically in android

I want to change the screen brightness programmatically in android. At the moment I use this code: WindowManager.LayoutParams lp = getWindow().getAttributes(); float brightness=1.0f; lp.screenBrightness =…
Sri Sri
  • 2,917
  • 7
  • 29
  • 37
30
votes
5 answers

Changing screen brightness programmatically (as with the power widget)

I was searching how to change the brightness of the screen programmatically and I found this it is very good solution and it works nice, but it works only while my app is active. After my application is shutdown then the brightness is returned back…
Lukap
  • 29,596
  • 60
  • 146
  • 239
19
votes
4 answers

How to change brightness in iOS 5 app?

How would I program the ability to change brightness in-app? I know that its possible as I have seen at least three apps that can do it. This would be very useful for my app. I know that it's only possible in iOS 5 with the UIScreen Class, but I…
cory ginsberg
  • 2,888
  • 6
  • 22
  • 36
18
votes
4 answers

Changing the Screen Brightness System Setting Android

I'm attempting to change the screen brightness from withing a service, like so: android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS, bright); Problem is that is doesn't work. Well,…
Kratz
  • 4,180
  • 3
  • 30
  • 51
12
votes
2 answers

Is iphone simulator's brightness adjustable?

i tried to use the most of the correct answers suggested by the users to adjust the brightness of the iphone (ie [[UIScreen mainScreen]setBrightness:0.0];) but the simulator didn't change its brightness. Is iphone simulator's brightness adjustable?…
iosMentalist
  • 2,940
  • 1
  • 27
  • 36
10
votes
2 answers

Dim screen on Windows with C++

I've been looking into dimming a screen on a Windows platform from my program. I know that there's a SetMonitorBrightness API that allows this, but the issue for me is that it would be nice to be able to dim the screen on Windows XP as well (which…
c00000fd
  • 18,074
  • 19
  • 132
  • 318
9
votes
3 answers

Update Display Brightness on Android after changing it programmatically

I'm trying to update the display brightness from a widget but i have some problems. To change brightness level, i use: Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200); This modifies the…
Mariux
  • 494
  • 6
  • 19
9
votes
5 answers

Android screen brightness Max Value?

WindowManager.LayoutParams layout = getWindow().getAttributes(); layout.screenBrightness = 1F; getWindow().setAttributes(layout); I added this code to button onClick and it worked ! But is there a higher value since the screen didn't…
A.J
  • 731
  • 6
  • 18
8
votes
3 answers

Adjust the brightness of the screen through code

I am developing an iPhone application and I need to adjust the brightness of the screen through my application, in the same way as we do through the Settings app. I have searched but have not found a solution.
Sid
  • 397
  • 1
  • 8
  • 17
8
votes
3 answers

How do I detect the screen brightness range on android?

I'm using the following code to set the screen brightness, which works fine on most phones: protected fun setBrightness(value: Float) { //Set the system brightness using the brightness variable value …
Grzegorz Adam Hankiewicz
  • 6,238
  • 1
  • 30
  • 65
8
votes
7 answers

How to set screen brightness with fade animations?

Is it possible to animate the screen brightness change on iOS 5.1+? I am using [UIScreen mainScreen] setBrightness:(float)] but I think that the abrupt change is ugly.
louissmr
  • 708
  • 8
  • 17
7
votes
3 answers

C# setting screen brightness Windows 7

I want ajust screen brightness by my self. Because Windows lets me only adjusting in limited range. I want dim the display from 0 to 100% and turning it off/on. It should be possible if windows can it do automatically (Dim display after: x…
sczdavos
  • 1,985
  • 10
  • 36
  • 66
6
votes
2 answers

UIScreen Brightness Property

At the moment I'm trying to create an application to adjust the device's brightness. In iOS5, there is the new brightness property for mainScreen that allows you to set the screen brightness. I'm using the following code: [[UIScreen mainScreen]…
ac3xx
  • 63
  • 1
  • 5
6
votes
2 answers

android - Setting the screen brightness to maximum level

I'm a newbie to this field of android development. These days i'm developing an app and I want to set the screen brightness to maximum level once I open the app, and set it back to the previous level once I exit the app. Can someone come up with the…
1
2 3
8 9