Tuesday, August 26, 2014

Oracle MAF - Disabling Landscape mode

Recently I had a requirement for disabling landscape orientation.
Frank and Chris suggested me below and it worked for me:

iOS
--------
For iOS on the deployment profile. 
Select Application --> Application Properties --> Deployment --> select iOS profile and and click on edit. Select device orientations. And there you will find option for enabling/disabling portrait/landscape modes for iPhone and iPad.


Android
------------
For Android there is an ER with Oracle.
Your workaround for the moment is to locate the AndroidManifestr.template.xml file in the <jdevhome>/jdeveloper/jdev/extensions/oracle.maf/Android directory and add the following two attributes for all activity tag:
android:screenOrientation="portrait" android:configChanges="orientation"

 example:
    <activity android:screenOrientation="portrait" android:configChanges="orientation" android:name="oracle.adfmf.phonegap.AdfSpringboardPhoneGapActivity" android:theme="@android:style/Theme.NoTitleBar" android:windowSoftInputMode="adjustResize"></activity>

Hope it helps.


Regards,
Deepak

4 comments:

  1. This didn't work for me...

    ReplyDelete
  2. Correcting the post before. This didn't work for me because I've not set a new deployment profile. Now it's working!!

    ReplyDelete
  3. there is one page which should be locked for portrait mode and should not be tilted thought device was oriented to landscape.how to restrict this for one single page?

    ReplyDelete