Obey screen rotation user preferences

6 posts, 0 answers
  1. Idan
    Idan avatar
    76 posts
    Member since:
    Oct 2012

    Posted 02 Apr 2014 Link to this post

    How can I cause my app to obey the screen rotation user preference. I've set my phone to not rotate the screen when I rotate my phone, but my app does rotate and doesn't obey this settings.

    any suggestions?
  2. Iva Koevska
    Admin
    Iva Koevska avatar
    286 posts

    Posted 03 Apr 2014 Link to this post

    Hello Idan,

    You need to set the supported interface orientation for your app from the general Project Properties. After you build and deploy your app on devices, this setting should be respected with one exception - the AppBuilder companion app.

    There is a known issue where the companion app does not support screen orientation lock. 

    Regards,
    Iva Koevska
    Telerik
     

    Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

     
  3. Idan
    Idan avatar
    76 posts
    Member since:
    Oct 2012

    Posted 06 Apr 2014 in reply to Iva Koevska Link to this post

    Hi Iva.

    Thanks for replying, but I think you misunderstood me. I want to allow both portrait and landscape. However, the user can set in his device that he doesn't want any app on his device to rotate. Which means that the app should show the default (portrait or landscape) orientation and not change when the user rotate his device.

  4. Iva Koevska
    Admin
    Iva Koevska avatar
    286 posts

    Posted 08 Apr 2014 Link to this post

    Hello Idan,

    Please, accept my apologies for the misunderstanding.

    We have tested this scenario and on iOS devices, the user preference for screen lock is respected.
    On Android devices, however, we have been able to reproduce the issue and identify it. We have logged it into our bug tracking system and will introduce a fix for it in a future release. 

    Basically, what you need to do to enable your app to respect the user settings is to modify AndroidManifest.xml. In the activity element , you need to set  screenOrientation to a desired value (unspecified, nosensor, user, or locked should do the trick - the behavior of each setting might differ from device to device though). You will have to rebuild your app for the changes to take effect.

    Important: At this point, until we introduce the fix, this will not work. Your setting will always be overriden by sensor which will cause your app to always rotate.

    Regards,
    Iva Koevska
    Telerik
     

    Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

     
  5. aminullah
    aminullah avatar
    1 posts
    Member since:
    Oct 2013

    Posted 26 Jul in reply to Iva Koevska Link to this post

    Hi,

    is there any fix for this issue ? 

     

    thanks,

  6. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 28 Jul Link to this post

    Hi Aminullah,

    A fix for this has been applied as now if you choose a specific orientation (portrait or landscape) from the Properties page, it is applied in the AndroidManifest.xml file.

    Also, if you wish, you can add another specification to that file, like so:
    <application android:label="@string/app_name"
                 android:icon="@drawable/icon"
                 android:hardwareAccelerated="$AndroidHardwareAcceleration$">
        <activity android:label="@string/app_name"
                  android:name=".TelerikCallbackActivity"
                  android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
                  android:launchMode="singleTop"
                  android:theme="@android:style/Theme.Black.NoTitleBar"
                  android:screenOrientation="nosensor" >

    and it will be respected after cloud build.

    Regards,
    Kaloyan
    Telerik by Progress
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top