Page 2 of 3

Lock Orientation on Android

Posted: Fri Oct 11, 2013 1:58 pm
by Timo Sehrbruch

thanks, i re-did the step, and now it works.

can be makred as resolved :)


Lock Orientation on Android

Posted: Fri Oct 11, 2013 2:01 pm
by Maryna Brodina

Hi Timo! Thank you for update! Glad it's working!


Lock Orientation on Android

Posted: Fri Feb 21, 2014 2:50 am
by ang .

I added the same code but the screen is still rotatable?
No build errors.

code
<?xml version="1&#46;0" encoding="utf-8"?>
<manifest xmlns:android="http:&#47;&#47;schemas&#46;android&#46;com/apk/res/android"
android:versionCode="7"
android:versionName="1&#46;0&#46;5" package="com&#46;gamemall2u&#46;gmgc">
<!-- GCM requires Android SDK version 2&#46;2 (API level 8) or above&#46; -->
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>

<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:resizeable="true" android:anyDensity="true" />

Code: Select all

 <permission android:name="com&#46;gamemall2u&#46;gmgc&#46;permission&#46;C2D_MESSAGE" 
     android:protectionLevel="signature" /> 
 <!-- Creates a custom permission so only this app can receive its messages&#46; --> 
 <uses-permission android:name="com&#46;gamemall2u&#46;gmgc&#46;permission&#46;C2D_MESSAGE" /> 

<uses-permission android:name="com&#46;google&#46;android&#46;c2dm&#46;permission&#46;RECEIVE"/>

<uses-permission android:name="android&#46;permission&#46;ACCESS_NETWORK_STATE" />
<uses-permission android:name="android&#46;permission&#46;INTERNET" />
<uses-permission android:name="android&#46;permission&#46;READ_PHONE_STATE" />
<uses-permission android:name="android&#46;permission&#46;WAKE_LOCK" />

<application android:icon="@drawable/appicon" android:label="@string/app_name" android:debuggable="false">
<activity android:name="&#46;PhoneGapActivity" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait">
/code


Lock Orientation on Android

Posted: Tue Jun 24, 2014 12:02 am
by deveu

I'm trying to get my android app to show in landscape only and have replaced the following code:
<activity android:name=".PhoneGapActivity" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden">

with:
<activity android:name=".PhoneGapActivity" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden" android:screenOrientation="landscape">

in my Source > ANDROID > business_android > AndroidManifest.xml

When testing using Android 4.3 Samsung Galaxy S3 i9305 I can't get the app to show 1280 width in landscape (I tested via apk and via appery tester)

http://appery.io/app/view/3d5107cf-12...


Lock Orientation on Android

Posted: Tue Jun 24, 2014 7:37 pm
by Evgene Karachevtsev

Hello,

Please provide us with more details what do you mean with "can't get the app to show width 1280"?
Can you please give us a screenshot? And when you test in the browser with different screen sizes (test frame or browser window, if you are testing without frame) everything works as you expect?


Lock Orientation on Android

Posted: Tue Jul 29, 2014 7:48 am
by Alessandro Pietrosanti

Hi, I need lock iPhone in portrait mode...what can i do? :)

Thanks for reply, Alessandro.


Lock Orientation on Android

Posted: Tue Jul 29, 2014 8:01 am
by Evgene Karachevtsev

Hello Alessandro,

You can do that on App Settings--iOS Keys tab. This post should help https://getsatisfaction.com/apperyio/...


Lock Orientation on Android

Posted: Tue Jul 29, 2014 8:34 am
by Alessandro Pietrosanti

Thank you! :) have a nice day


Lock Orientation on Android

Posted: Fri Jan 23, 2015 8:35 pm
by Mike6580064

I just want to clarify the correct fix for locking my app in portrait mode on Android.

On the AndroidManifest.xml file I see two instances that appear to deal with orientation and I'm not sure which one to edit:

activity android:name=".PhoneGapActivity" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden|screenSize"

and

activity android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden"


Lock Orientation on Android

Posted: Sun Feb 01, 2015 8:13 pm
by M&M

hi Mike,

It is the first one. It should look like this

code
<activity android:name="&#46;PhoneGapActivity" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden|screenSize" android:screenOrientation="portrait" >
/code

I had no issues getting the orientation to lock in portrait mode on Android. But I haven't been able to get the sensorPortrait to work though. Heard somewhere along the line google made a typo and replaced sensorPortrait by sensorPortait