Lock Orientation on Android
thanks, i re-did the step, and now it works.
can be makred as resolved
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
thanks, i re-did the step, and now it works.
can be makred as resolved
Hi Timo! Thank you for update! Glad it's working!
I added the same code but the screen is still rotatable?
No build errors.
code
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="7"
android:versionName="1.0.5" package="com.gamemall2u.gmgc">
<!-- GCM requires Android SDK version 2.2 (API level 8) or above. -->
<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.gamemall2u.gmgc.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<!-- Creates a custom permission so only this app can receive its messages. -->
<uses-permission android:name="com.gamemall2u.gmgc.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application android:icon="@drawable/appicon" android:label="@string/app_name" android:debuggable="false">
<activity android:name=".PhoneGapActivity" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait">
/code
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)
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?
Hi, I need lock iPhone in portrait mode...what can i do?
Thanks for reply, Alessandro.
Hello Alessandro,
You can do that on App Settings--iOS Keys tab. This post should help https://getsatisfaction.com/apperyio/...
Thank you! have a nice day
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"
hi Mike,
It is the first one. It should look like this
code
<activity android:name=".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