On Thu, Apr 23, 2009 at 9:34 PM, coredump <jose.jun...@gmail.com> wrote:
>
> So I tried the 'correct' way to do it:
>
> Settings.System.putInt(getContentResolver(),
> Settings.System.SCREEN_BRIGHTNESS, 255);
>
> And it doesnt work. It seems to change the brightness value on the
> Display Settings Screen but not the actual display brightness. I tried
> with putString too, no game.
>
> I also tried to use the IHardware approach (described by joby some
> messages ago), but it seems to doesn't even exist on SDK 1.1 (at least
> eclipse could not resolve it).

It never existed on the SDK 1.1 as an official API, so the SDK won't
know about it.


> But there must be one way working because the Flashlight app on the
> Market does that perfectly. So, if anyone can provide a different
> approach I will be very thankful.

What SDK are you targetting?

For SDKs 1.0 and 1.1, the API was unfortunately there but not official
to make flashlights.

For SDK 1.5 there's a new *official* way to do a simple flashlight. No
hacks involved and you're guaranteed it will work. Dianne posted the 2
lines of code that you need earlier in the thread.

If you want a more complete example:
http://code.google.com/p/autosettings/source/browse/trunk/Flashlight/src/com/alfray/flashlight/FlashlightActivity.java

R/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to