Page 1 of 2

how disabling auto rotate screen thru code?

Posted: Fri Apr 27, 2012 8:38 am
by yllaw

Hi

I like to ask if is there a way that I can disable auto rotate screen thru code?


how disabling auto rotate screen thru code?

Posted: Fri Apr 27, 2012 6:40 pm
by maxkatz

Unfortunately there is no simple way to do it, plus iOS and Android work differently. Here is more information:

http://stackoverflow.com/questions/60...
http://code.google.com/p/chromium/iss...

Some people are doing it via PhoneGap:
http://stackoverflow.com/questions/74...

You could also try listening to orientationchange event:
http://stackoverflow.com/questions/52...

I didn't find a universal solution that would work for both iOS and Android.


how disabling auto rotate screen thru code?

Posted: Sat Apr 28, 2012 10:55 am
by yllaw

Thanks Max for the response, anyway I let it check all your given links.


how disabling auto rotate screen thru code?

Posted: Tue Feb 25, 2014 11:51 pm
by marieall

Hi Max, since the post is 1 year old, I am wondering if there is any easier way now to lock the screen rotation of my app, or at the very least of one page of my app, without exporting the projecting to Eclipse ? (whatever is easier)

I don't know anything about eclipse and when I tried, to open my project in Eclipse, it opened with error and i can't create an apk from it. (Plus I don't know where and to amend the androidmanifest.xml file... )

thanks for your help in advance :)


how disabling auto rotate screen thru code?

Posted: Wed Feb 26, 2014 12:11 pm
by Maryna Brodina

Please check https://getsatisfaction.com/apperyio/...
You don't need to export app to Eclipse, it can be done through Appery.io builder on Source tab.


how disabling auto rotate screen thru code?

Posted: Wed Feb 26, 2014 12:14 pm
by marieall

that's a big relief for me!!
So i juste need to put android:screenOrientation="portrait" in each activity on the androidmanifest file? that's it? or in a specific activity?


how disabling auto rotate screen thru code?

Posted: Wed Feb 26, 2014 12:22 pm
by Maryna Brodina

Yes:)
Just checked again. Looks like there is no way to lock orientation for a specific screen, but you can do that for entire app.


how disabling auto rotate screen thru code?

Posted: Wed Feb 26, 2014 12:22 pm
by marieall

I just amended all activity with the code line, but now i have this message when i try to build the apk: Build error

Would you be OK to help me check what I've done wrong on the file? Can I send you the content of the file ?


how disabling auto rotate screen thru code?

Posted: Wed Feb 26, 2014 12:29 pm
by Maryna Brodina

Please send us this file to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a


how disabling auto rotate screen thru code?

Posted: Wed Feb 26, 2014 3:08 pm
by marieall

done!