Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9250677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:30:08+00:00 2026-06-18T10:30:08+00:00

I am creating an application which will change the orientation of some other already

  • 0

I am creating an application which will change the orientation of some other already installed application, Reading the orientation of other application installed was simple through ApplicationInfo object but no way to change it.

After some R&D I have come to notice similar types of apps (which change orientation) also run Service, that means they make orientation change on fly but I don’t know how exactly they do it.

For example like Smart Rotator app does it https://play.google.com/store/apps/details?id=net.xdevelop.rotator_t&hl=en

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:30:10+00:00Added an answer on June 18, 2026 at 10:30 am

    The other apps that you reference do something different to what you might be expecting. They enable screen rotation based on the device’s accelerometer; that is, the user rotates the device and the orientation changes. They do not set a specific orientation for any application. Note that if you disable automatic rotation whilst in landscape mode, the orientation typically returns to portrait.

    I have done the same as these other applications before. Unfortunately it’s proprietary commercial code that I’m not in a position to share.

    There are two components to the approach:

    1. Detect when the foreground application is the target app
    2. Change the system-wide preference for display orientation

    Obviously you have to do the reverse too, i.e. change it back afterwards.

    There are some examples of piece 1 elsewhere on SO. In my case I wrote a service that continuously polled to see what the foreground app is (because there are no relevant system events to inform of app change). It’s not a trivial undertaking but it can be done.

    The relevant setting for piece 2 is Settings.System.ACCELEROMETER_ROTATION. I think you can write that with an ordinary app permission on all versions. The code snippet for that is below:

            Settings.System.putInt(
                 app.getContentResolver(),
                 Settings.System.ACCELEROMETER_ROTATION,
                 orientationEnabled ? 1 : 0
            );
    

    Note also that it is possible to write an application that will ignore the system’s screen rotation; i.e. will stay locked in whatever orientation it was designed for. It’s not common though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an Android application which will have some embedded music inside of
I am creating an application, which will save the current time (with some delay
I'm creating a simple eclipse application which will contain only views. I've chosen to
I'm in the process of creating a C# application which will monitor changes made
I am creating a small application which will perform say 4 different, time consuming
I am creating a Silverlight application which will be heavily javascripted against. To enable
I'm creating a VB2010 application which will require a connection to MSSQL. Should I
i am creating a java application which is will be GUI for a bash
i am creating an application which includes dynamic pages. actually, i created some dynamic
I'm currently in the process of creating a Windows service application which will monitor

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.