Page 1 of 3

Lock Orientation on Android

Posted: Thu May 16, 2013 6:54 am
by Timo Sehrbruch

hey there, as I worked myself through the topics here, I found out that I have to export my app as eclipse project to edit the android manifest xml to enable orientation locking.

but I actually dont see why, because as refered in here (http://developer.android.com/guide/to...) the permissions which can be set within appery app builder are also in the manifest, so where is the deal with the orientation?

it would be a GREAT addition to have it in for android as well!


Lock Orientation on Android

Posted: Thu May 16, 2013 1:36 pm
by Kateryna Grynko

Hi Timo,

Sorry for the delay.

You would need to export your app to Eclipse project, then open AndroidManifest.xml file (not the one in "BarcodeScanner" folder).

Then replace the following code:
code<activity android:name="&#46;PhoneGapActivity" android:configChanges="orientation|keyboardHidden">/code
with the code below:
code<activity android:name="&#46;PhoneGapActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait">/code
You can find all possible values for android:screenOrientation in docs: http://developer.android.com/intl/ru/...)
But you would need to rebuild your app with Android SDK installed.

This is not the best solution as it's said here:
http://stackoverflow.com/questions/15...

Maybe you can develop a better solution.


Lock Orientation on Android

Posted: Fri May 17, 2013 7:08 am
by Timo Sehrbruch

Thanks Katya for your answer.

I know the way with the Android Manifest and I think I will to it this way,

BUT (yeah, there is always a but..)

how can I savely compile my exported eclipse project to a apk?


Lock Orientation on Android

Posted: Fri May 17, 2013 8:56 am
by Kateryna Grynko

Hi Timo,

You can find an answer here:
https://developer.android.com/tools/i...

They have a lot of good guides.


Lock Orientation on Android

Posted: Tue May 21, 2013 2:24 pm
by Timo Sehrbruch

just another question/idea.

as the permissions for the app are also located in the AndroidManifest.xml, how come that the orientation string cannot be included, for example a simple dropdown within the wizard

Portrait
Landscape
Auto-Rotate (default)

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

obviously you can modify the xml below

code<application&#46;&#46;&#46;>/code

because of

code<activity android:name="&#46;PhoneGapActivity" android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="com&#46;project&#46;name&#46;MESSAGE"&#47;>
/code

as I don't know how you create the AndroidManifest.xml, this is just a guess.


Lock Orientation on Android

Posted: Tue May 21, 2013 6:37 pm
by Kateryna Grynko

Hi Timo,

We'll think about adding this feature.


Lock Orientation on Android

Posted: Tue Oct 08, 2013 12:38 pm
by Timo Sehrbruch

Hi Katya,

any recent updates regarding this issue?

Greetings


Lock Orientation on Android

Posted: Tue Oct 08, 2013 12:48 pm
by Maryna Brodina

Hello Timo! There is no plan to add dropdown to select those options, but there is no need to export app source code, you can edit AndroidManifest.xml on Source tab inside editor.


Lock Orientation on Android

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

Dear Maryna,

thanks for this hint, will try it immediatly and will give you feedback!


Lock Orientation on Android

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

I tried the following:

Then replace the following code:
code
<activity android:name="&#46;PhoneGapActivity" android:configChanges="orientation|keyboardHidden">
/code
with the code below:
code
<activity android:name="&#46;PhoneGapActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait">
/code

and then my build fails.