Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.
Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.
It will only modify the screen while that window/activity is being shown to
the user. This allows it to be done in a safe way (no permission required)
which the system can recover from if there is a bug in the application (or
if the application gets killed for some reason, as we tend to do).
On Wed, Apr 8, 2009 at 12:56 PM, Todd Sjolander <GuyFantas...@gmail.com>wrote:
> Do you mean that the brightness changes will only affect a particular
> Activity or process, like a new xml tag for the activity or
> application tag?
> Also, thanks for the quick reply!
> On Apr 8, 3:49 pm, Dianne Hackborn <hack...@android.com> wrote:
> > There is a new API to be able to force the screen brightness while your
> > window is on-screen.
> > On Wed, Apr 8, 2009 at 12:08 PM, Todd Sjolander <GuyFantas...@gmail.com
> >wrote:
> > > Dianne,
> > > Is there a new way to do this in Cupcake, or is the functionality
> > > being removed?
> > > On Mar 23, 1:37 pm, Dianne Hackborn <hack...@android.com> wrote:
> > > > This is a private API and will break in Cupcake.
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails. All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.
> It will only modify the screen while that window/activity is being shown to
> the user. This allows it to be done in a safe way (no permission required)
> which the system can recover from if there is a bug in the application (or
> if the application gets killed for some reason, as we tend to do).
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.
On Wed, Apr 15, 2009 at 10:21 PM, SR <Stan.R...@gmail.com> wrote:
> Dianne,
> Would you mind sharing a snippet of code on how to do this in Cupcake
> using the new API?
> Thanks!
> Stan
> On Apr 8, 3:49 pm, Dianne Hackborn <hack...@android.com> wrote:
> > There is a new API to be able to force the screen brightness while your
> > window is on-screen.
> > On Wed, Apr 8, 2009 at 12:08 PM, Todd Sjolander <GuyFantas...@gmail.com
> >wrote:
Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.
for example right now i was thinking to write a simple app just
changing the brightness
in a simple way. not just for a window, for the whole system.
Often I am out and just like a simple "change brightness", without
searching through
the setup (imagine i am in the sun and already dont see anything) so
even 2 steps
are far away.
anyhow.. is there an intent how i can easily open the popup where i
can change the
system brightness?
thanks
chris
On Apr 16, 11:40 am, Dianne Hackborn <hack...@android.com> wrote:
> // Make the screen full bright for this activity.
> WindowManager.LayoutParams lp = getWindow().getAttributes();
> lp.screenBrightness = 1.0f;
> getWindow().setAttributes(lp);
> On Wed, Apr 15, 2009 at 10:21 PM, SR <Stan.R...@gmail.com> wrote:
> > Dianne,
> > Would you mind sharing a snippet of code on how to do this in Cupcake
> > using the new API?
> > Thanks!
> > Stan
> > On Apr 8, 3:49 pm, Dianne Hackborn <hack...@android.com> wrote:
> > > There is a new API to be able to force the screen brightness while your
> > > window is on-screen.
> > > On Wed, Apr 8, 2009 at 12:08 PM, Todd Sjolander <GuyFantas...@gmail.com
> > >wrote:
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.
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).
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.
> 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.
It must still be possible in 1.5 cupcake:
- "PowerManager" can set it
- "Settings -> Sound&Display -> Brightness" can change it
- haven't checked "Locale"
While the system setting might have privileged access to the API, the
PowerManager is just a normal program. So how do they do it?
This is indeed frustrating..... however, there's a funny new
wrinkle.... whenever I use the new cupcake-approved sugar-free method,
the brightness stays after I go back to the home screen. (yay) I seem
to have problems when brightness gets too low though (IE, cant do
anything with the unit ... obviously). So do yourself a favor and put
a lower limit on it ;) I set mine to .1.
On May 28, 12:06 am, Mark <android.eggenst...@googlemail.com> wrote:
> It must still be possible in 1.5 cupcake:
> - "PowerManager" can set it
> - "Settings -> Sound&Display -> Brightness" can change it
> - haven't checked "Locale"
> While the system setting might have privileged access to the API, the
> PowerManager is just a normal program. So how do they do it?