Disable screen orientation & accelerometer management

424 views
Skip to first unread message

Clem

unread,
Jan 2, 2010, 10:48:18 AM1/2/10
to phonegap
Hi
As i'm currently building an app using the accelerometer, i was
wondering if it's possible to disable the screen automatic
orientation?
By the way, do you know if "getCurrentAcceleration" returns the same
values on the iPhone and on an Android phone?
And if the x,y,z axis have the same orientation on all devices?
Thanks in advance.
Clem

Shazron Abdullah

unread,
Jan 2, 2010, 5:31:47 PM1/2/10
to Clem, phonegap
In the PhoneGap.plist, uncheck the boolean value for "AutoRotate".

On 2010-01-02, at 7:48 AM, Clem wrote:

> Hi
> As i'm currently building an app using the accelerometer, i was
> wondering if it's possible to disable the screen automatic
> orientation?

> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

Clem

unread,
Jan 3, 2010, 11:38:54 AM1/3/10
to phonegap
Ok thank you.
I guess it's for the iphone project.
Do you know how to disable it on android ?

Clem

unread,
Jan 5, 2010, 8:01:36 AM1/5/10
to phonegap
About my 2nd question,

"do you know if "getCurrentAcceleration" returns the same values on
the iPhone and on an Android phone? "

I tested it on 2 different Android phones (htc hero and samsung galaxy
i7500) and it actually returns the same values :
when i lay down the phone on a table (x = 0 and y = 0) and i lean
it :
- on the left => x values increase (from 0 to 10)
- on the right => x values decrease (from 0 to -10)
- on the top => y values decrease (from 0 to -10)
- on the bottom => y values increase (from 0 to 10)

I can't test it on the iphone, can someone do it for me please (with
the phonegap demo app)?
Thank you very much.

Reply all
Reply to author
Forward
0 new messages