Android - Is it possible to have the Auto rotate feature turned on or off by app?

This solution requires Tasker installed and enabled. Tested on Android 4.2.1, 4.4.2, 5.0.2 and 5.1.1.

  1. Create a profile with Application → Maps
  2. Create an action under Task of the above profile as + → Display → Display AutoRotate and Set it to On.
  3. Enable Profile and Tasker.

Open Maps and orient your device in landscape mode, Maps will follow you. Close the Maps and device will fall back to Portrait.

Enjoy!


OR

Edit start: 06/06/2015

There is a way you can force the system to go into Landscape mode by changing a value in settings.db. (Tested on Android 4.2.1, root required only under this edit.)

  1. Create a profile with Application → Maps.
  2. Create an action under Task of the above profile as + → Code → Run Shell, and enter the following details:

    • Command: settings put system user_rotation 1
    • Check Use Root.
  3. Create another profile with inverse of Application → Maps.
  4. Create an action under Task of the above profile as + → Code → Run Shell, and enter the following details:

    • Command: settings put system user_rotation 0
    • Check Use Root.
  5. Enable both Profiles and Tasker.

The Maps will now automatically go into Landscape mode irrespective of manual orientation of your device. Once you close it the device will come back to Portrait mode. (Note that OP has Auto-rotation feature off so it should work.)

This edit is meant for users like me who on slow devices have to wait for the app to follow their orientation. :)

Enjoy!

OR

The shortcoming in the last method is that on some devices the app will first open in Portrait mode and then will force shift into Landscape mode. However, the app can be directly launched into Landscape mode by using an app shortcut. Tasker allows it and we'll use it.

  1. Go to your default launcher → Widgets and choose Task Shortcut.
  2. Select New task → name it.
  3. Create an action as + → Code → Run Shell, and enter the following details:

    • Command: settings put system user_rotation 1
    • Check Use Root.
  4. Create another action as +App → Launch App → select Maps.
  5. To change th icon of the shortcut, tap 3x3 square icon (at the bottom of Task Shortcut window) and choose the icon.
  6. You'll now see a shortcut with icon you selected in step 4 and name chosen in step 2.
  7. Create a profile in Tasker with inverse of Application → Maps.
  8. Create an action under Task of the above profile as + → Code → Run Shell, and enter the following details:

    • Command: settings put system user_rotation 0
    • Check Use Root.
  9. Enable both Profiles and Tasker.

Now enjoy the forced auto-mode!

Edit closed: 06/06/2015


For folks who're new to Tasker

  1. Launch Tasker. (Note that once you're done changing something in Tasker, tap Back key once. Tasker will change/close the active window and would save the settings.)
  2. Under PROFILES tab tap +Application → choose MapsNew Task→ name it something and tap right icon.

    Some Android versions might ask you to enable Tasker's accessibility service. Do it by following the instructions there and come back to Tasker.

    This step would create a profile that will be triggered whenever Maps is launched by the user.

  3. We're now under the named task (inside TASKS tab). Tap +Display → Display AutoRotate → choose On below Set.

    We're creating an action here which will be executed once the profile is triggered.

  4. Come back to main screen of the Tasker and you'll see a profile with Maps app name and marked as On.
  5. Minimize the Tasker and you'll see its icon in the Notification bar. It will say No active profile. The message will change once you launch Maps.
  6. Well, launch Maps and see the magic. You orient your device and Maps will do the same. You close the Maps and device will come back to Portrait Mode.
  7. You can always stop this behavior by disabling or deleting the profile in Tasker. You can also hide Tasker's notification icon through its settings.

Enjoy Maps now!


If you are rooted (and probably not using lollipop), then you can also use xposed module App Settings.

Open the module, search and open Maps and go to Orientation section and select "auto-rotate". This will force it to auto-rotate.


You can use an app called Set Orientation by "Eyes-Free Project". It dose not require root and can force any app to rotate to any orientation and also only landscape and landscape reverse based on sensor. Its lightweight and also free. It is available in Google Play Store.

Edit: Use Rotation - Orientation Manager instead by "Pranav Pandey". It is fully compatable with Lollipop, is free and does not require root. This app also has per app settings which the previous app did not have.