Home News Forum Social Networking Support Us Advertise

Spanish Lesson 1 ($1.99)

aWake!Gently ($1.99)

The Bird & The Snail - Knock Knock - Deluxe ($4.99)

Match-It Trains ($0.99)

Tangled ($0.99)

iFlatter ($0.99)

The 15 puzzle ($0.99)

Tap Forms Database ($8.99)

Higher or Lower Card Game (Hi Lo) ($0.99)

Red Pixel ($0.99)

Time-Shift Radio ($0.99)

Want your application advertised here? Only $10/week!

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-11-2008, 09:15 AM   #1 (permalink)
Member
 
Join Date: Aug 2008
Posts: 77
Rep Power: 1
ecume is on a distinguished road
Default adjusting screen brightness

I assume you need to jailbreak to get access to system controls like this, but I'll throw this out there in case someone has discovered a handy solution...
ecume is offline   Reply With Quote
Old 11-11-2008, 09:36 AM   #2 (permalink)
Senior Member
 
Join Date: Aug 2008
Posts: 211
Rep Power: 1
lapse is on a distinguished road
Default

I believe the application 'Light' was removed from the store for messing with the screen brightness.
lapse is offline   Reply With Quote
Old 11-11-2008, 09:40 AM   #3 (permalink)
Member
 
Join Date: Nov 2008
Posts: 74
Rep Power: 1
SkylarEC is on a distinguished road
Default

Yes, Apple will reject your app if you mess with the brightness. Although, if you still want to do it, you'd get the current brightness like this:
Code:
-(void)getBacklightLevel;{
	NSNumber *bl = (NSNumber*) CFPreferencesCopyAppValue(CFSTR("SBBacklightLevel" ), CFSTR("com.apple.springboard"));
	 previousBacklightLevel = [bl floatValue]; //a variable to store the previous level so you can reset it.
	 [bl release];
}
And to set the backlight level, add this line
Code:
GSEventSetBacklightLevel(newLevel); //The new level: 0.0 - 1.0.
In order for this to work, you will need to include GraphicsServices.h. Depending on where you get your headers, you may need to add the GSEventSetBacklightLevel(float value); method to the headers, else the method won't quite work. [Some have reported kernel panics by not amending the header, but that has not been my experience]
SkylarEC is offline   Reply With Quote
Old 03-29-2009, 03:32 PM   #4 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Sep 2008
Location: London, UK
Posts: 704
Rep Power: 1
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by SkylarEC View Post
Yes, Apple will reject your app if you mess with the brightness. Although, if you still want to do it, you'd get the current brightness like this:
Code:
-(void)getBacklightLevel;{
	NSNumber *bl = (NSNumber*) CFPreferencesCopyAppValue(CFSTR("SBBacklightLevel" ), CFSTR("com.apple.springboard"));
	 previousBacklightLevel = [bl floatValue]; //a variable to store the previous level so you can reset it.
	 [bl release];
}
And to set the backlight level, add this line
Code:
GSEventSetBacklightLevel(newLevel); //The new level: 0.0 - 1.0.
In order for this to work, you will need to include GraphicsServices.h. Depending on where you get your headers, you may need to add the GSEventSetBacklightLevel(float value); method to the headers, else the method won't quite work. [Some have reported kernel panics by not amending the header, but that has not been my experience]
wow sorry to raise such as an old thread, but does anyone know if this still works. I can't seem to return the current backlight value anymore (I'm sure it worked once)....its for a private app BTW so no App store violations

TIA, Michael.
__________________
APODViewer, APODViewerLite - Nasa's Astronomy Picture of the Day (APOD) from your iPhone
aWake!Simply - sometimes "less is more" aWake!Gently - wake as nature intended
London JamCams - ease that journey

sendmetospace.co.uk
wuf810 on Twitter
wuf810 is offline   Reply With Quote
Old 05-01-2009, 08:13 PM   #5 (permalink)
Junior Member
 
Join Date: May 2009
Posts: 4
Rep Power: 0
lewis is on a distinguished road
Default

Quote:
Originally Posted by lapse View Post
I believe the application 'Light' was removed from the store for messing with the screen brightness.
I've seen two applications ("Astronomy Flashlight" and "Flashlight.") in the store that adjust the screen's brightness one way or another. They probably don't adjust the system brightness but they seem to have a way to "dim" the screen. Any ideas? It appears possible if (at least) two apps have made it into the store.
lewis is offline   Reply With Quote
Old 05-01-2009, 09:17 PM   #6 (permalink)
Junior Member
 
Join Date: Apr 2009
Posts: 11
Rep Power: 0
arutad is on a distinguished road
Default

Sneaky..!

Quote:
Originally Posted by SkylarEC View Post
In order for this to work, you will need to include GraphicsServices.h. Depending on where you get your headers, you may need to add the GSEventSetBacklightLevel(float value); method to the headers, else the method won't quite work. [Some have reported kernel panics by not amending the header, but that has not been my experience]
arutad is offline   Reply With Quote
Old 05-02-2009, 08:59 AM   #7 (permalink)
ftm
FasterThanMonkeys.com
iPhone Dev SDK Supporter
 
Join Date: Mar 2009
Location: Southern California
Posts: 410
Rep Power: 1
ftm is on a distinguished road
Send a message via AIM to ftm
Default

I think Flashlight may just be using different color backgrounds... gray's appear dimmer than whites.
__________________
Website: http://fasterthanmonkeys.com

iPhone Apps:

Bug Squash (Has been #1 kids game in 10+ countries including US)
Bug Squash Lite (Currently top 10 kids game in 35 countries including US)
Patternz
Patternz Lite (Free Puzzle Game)
iScore Baseball Scorekeeper (Has been as high as #3 Sports app in US)
ftm is offline   Reply With Quote
Old 05-02-2009, 11:16 AM   #8 (permalink)
Junior Member
 
Join Date: May 2009
Posts: 4
Rep Power: 0
lewis is on a distinguished road
Default

Quote:
Originally Posted by ftm View Post
I think Flashlight may just be using different color backgrounds... gray's appear dimmer than whites.
Perhaps, but that doesn't explain how "Astronomy Flashlight" works and even if "Flashlight." does just use grays, how does it fade from one color to the gray?
lewis is offline   Reply With Quote
Old 05-02-2009, 11:33 AM   #9 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Sep 2008
Location: London, UK
Posts: 704
Rep Power: 1
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by lewis View Post
Perhaps, but that doesn't explain how "Astronomy Flashlight" works and even if "Flashlight." does just use grays, how does it fade from one color to the gray?
they don't adjust the backlight levels...all they are doing is adjusting the alpha level of the top (red) view.
__________________
APODViewer, APODViewerLite - Nasa's Astronomy Picture of the Day (APOD) from your iPhone
aWake!Simply - sometimes "less is more" aWake!Gently - wake as nature intended
London JamCams - ease that journey

sendmetospace.co.uk
wuf810 on Twitter
wuf810 is offline   Reply With Quote
Old 05-03-2009, 02:38 PM   #10 (permalink)
Junior Member
 
Join Date: May 2009
Posts: 4
Rep Power: 0
lewis is on a distinguished road
Default

Quote:
Originally Posted by wuf810 View Post
they don't adjust the backlight levels...all they are doing is adjusting the alpha level of the top (red) view.
Oh, I see. Thanks.

So does anyone know how to find the GraphicsServices library? I know I won't be able to submit it to the App Store, but I can still use it personally, can't I? I located the GraphicsServices.framework (several, actually), but when I try and expand it there are no headers listed? Did Apple just remove access to this completely or is there something else that needs to be done? TIA.
lewis is offline   Reply With Quote
Old 05-03-2009, 02:57 PM   #11 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Sep 2008
Location: London, UK
Posts: 704
Rep Power: 1
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by lewis View Post
Oh, I see. Thanks.

So does anyone know how to find the GraphicsServices library? I know I won't be able to submit it to the App Store, but I can still use it personally, can't I? I located the GraphicsServices.framework (several, actually), but when I try and expand it there are no headers listed? Did Apple just remove access to this completely or is there something else that needs to be done? TIA.
check out this link The iPhone SDK: APIs Apple Didn't Want You to Know About | O'Reilly Media

It has all the info you need but its quite complicated if you are new to this sort of stuff.

M.
__________________
APODViewer, APODViewerLite - Nasa's Astronomy Picture of the Day (APOD) from your iPhone
aWake!Simply - sometimes "less is more" aWake!Gently - wake as nature intended
London JamCams - ease that journey

sendmetospace.co.uk
wuf810 on Twitter
wuf810 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements


» Online Users: 173
10 members and 163 guests
Alexman, atsd, BostonMerlin, lepetitapps, Neverever, P-atr1k, Raphy, Sekharbethalam, Slecorne, _mubashir
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 8,172
Threads: 20,132
Posts: 89,979
Top Poster: RickMaddy (2,121)
Welcome to our newest member, juicysen
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:18 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0