Questions tagged [screen-brightness]
141 questions
56
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,920
- 10
- 43
- 66
41
votes
5 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
- 3,107
- 7
- 34
- 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
- 31,523
- 64
- 157
- 244
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,907
- 6
- 25
- 37
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,280
- 3
- 32
- 55
15
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
- 3,066
- 1
- 30
- 40
12
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
- 7,349
- 1
- 36
- 78
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
- 20,994
- 29
- 177
- 400
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
4 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…

Sankha Rathnayake
- 763
- 8
- 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
- 726
- 1
- 7
- 19
8
votes
2 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
- 2,035
- 11
- 37
- 71
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
- 407
- 1
- 9
- 17
8
votes
3 answers
Setting full screen brightness in an Android activity
I'm using this method to set the screen to full brightness.
@SuppressLint("NewApi")
private void setFullBright() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
WindowManager.LayoutParams windowParams =…

TechAurelian
- 5,561
- 5
- 50
- 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
- 748
- 8
- 18