FORUMS
Remove All Ads from XDA

[APP] Rotation Locker v1.4 - Landscape & Portrait lock

3,666 posts
Thanks Meter: 4,762
 
By madmack, Senior Member on 27th December 2011, 02:40 AM
Post Reply Email Thread
Hello everyone.

I wrote this app to allow a user to lock the screen rotation in landscape, portrait or auto. The app is very simple, when you click on it, you're faced with these three options.

Long press on Landscape if you want the app to run as a background service (only use this if landscape mode terminates on its own).

I searched on the Market for an app that would lock the screen in landscape mode and found only one paid app that does it but actually runs a service continuously in the background regardless of the orientation mode. This app is free and the background service is optional

so without further ado . . .





Change log:

v1.4.2 Dec 30 2013
+ Make apk available to google TV devices

v1.4 Nov 20 2012
+ Added a footer note to expose persistent mode better

v1.3 Mar 9 2012
+ Added a widget that will lock into whatever your current phone's orientaion is. Useful for reverse landscape for example

v1.2.2 Feb 23 2012
+ Short click on portrait/auto will behave like default android portrait/auto. If you want to enforce "auto" long press on it (that way, even the apps that don't go into landscape will).

v1.2.1 Feb 9 2012
+ Added ability to run a persistent background service for both Portrait and Auto modes.

v1.2 Jan 2 2012
+ Locale plugin.
+ Long press on search button to run app.

v1.1 Dec 29 2011
Added ability to long press on Landscape to enforce a background service. Only use this if landscape mode seems to exit suddenly and abruptly.

v1.0. Dec 27 2011
-Initial release
Attached Thumbnails
Click image for larger version

Name:	new2.png
Views:	9800
Size:	15.8 KB
ID:	834868   Click image for larger version

Name:	device-2012-11-20-112714.png
Views:	3687
Size:	38.9 KB
ID:	1497337  
Attached Files
File Type: apk Rotation-Locker-v1.4.2.apk - [Click for QR Code] (65.7 KB, 20226 views)
The Following 94 Users Say Thank You to madmack For This Useful Post: [ View ] Gift madmack Ad-Free
 
 
27th December 2011, 04:41 AM |#2  
Member
D-town
Thanks Meter: 8
 
More
Cool, works great on my ICS captivate

Sent from my SGH-I897
B.Jay
27th December 2011, 08:45 PM |#3  
Guest
Thanks Meter: 0
 
More
Thank you very much for this app, madmack.
That's what I've been looking for since like forever ...

With this I can confirm it works almost perfectly with Android-x86 (2.3rc1); "almost" because sometimes an app starts in portrait mode instead of landscape (exiting the app and re-running your Rotation Locker usually fixes the problem).

At any rate, Android-x86 just became a whole lot more usable at least for me.
27th December 2011, 09:25 PM |#4  
madmack's Avatar
OP Senior Member
Flag Boston, MA
Thanks Meter: 4,762
 
Donate to Me
More
Quote:
Originally Posted by B.Jay

Thank you very much for this app, madmack.
That's what I've been looking for since like forever ...

With this I can confirm it works almost perfectly with Android-x86 (2.3rc1); "almost" because sometimes an app starts in portrait mode instead of landscape (exiting the app and re-running your Rotation Locker usually fixes the problem).

At any rate, Android-x86 just became a whole lot more usable at least for me.

awesome guys. thanks for your confirmation

I went ahead and released it in the market a few hours ago.

B.Jay, does your screen switch to portrait entirely when that happens or is it just localized to certain apps while the Home screen actually remains in landscape? I'm thinking I might have to implement a persistent service to be run in the background when running Landscape mode if landscape seems to suddenly switch off for the entire system.
27th December 2011, 11:53 PM |#5  
androidboss7's Avatar
Senior Member
Thanks Meter: 84
 
More
Testing.....

Sent from my LG GT540 using xda premium
28th December 2011, 12:03 AM |#6  
UKseagull's Avatar
Senior Member
Thanks Meter: 98
 
More
Also testing, thanks!

Sent from my HTC Sensation XE with Beats Audio Z715e using xda premium
28th December 2011, 09:14 AM |#7  
K Dotty's Avatar
Senior Member
Flag London
Thanks Meter: 361
 
More
Didn't work for me, tried with different lookscreen types (ring, slider and lenses) I'm using a cm7 based rom.

Sent by wiggling my big toe
B.Jay
28th December 2011, 11:39 AM |#8  
Guest
Thanks Meter: 0
 
More
Quote:
Originally Posted by madmack

B.Jay, does your screen switch to portrait entirely when that happens or is it just localized to certain apps while the Home screen actually remains in landscape? I'm thinking I might have to implement a persistent service to be run in the background when running Landscape mode if landscape seems to suddenly switch off for the entire system.

It's only the app that changes/reverts to portrait mode ... the launcher itself stays in landscape (replaced the stock Gingerbread launcher with LaucherPro, which works perfect in Android-x86). Like I said, when it happens that the app starts in portrait instead of landscape (Google Maps or AndroIRC for example - yes, I managed to successfully inject the Google Apps into Android-x86 to have the Market and stuff) it's sufficient to exit the app, re-run your Locker and start the app anew to have it in landscape mode.

Thanks to your app I'm now able to use my old Eee PC 900A as a Android powered netbook.

Anyway, I'm deeply satisfied with the way it works now, but if you're able to improve the app so it works as a service that keeps the screen orientation locked it would be plain awesome.
28th December 2011, 08:34 PM |#9  
vibranturk's Avatar
Senior Member
Flag Ankara
Thanks Meter: 2,295
 
Donate to Me
More
cool i will try ın ics
29th December 2011, 10:44 AM |#10  
Senior Member
Flag Tampere
Thanks Meter: 13
 
More
Works like a charm on SGS running CyanogenMod.
Thanks, been looking app like this, but none of them worked on my phone
29th December 2011, 11:16 PM |#11  
Member
Flag Peterborough
Thanks Meter: 2
 
More
Can't get this to work on my Xperia x8. Soon as I lock the screen it reverts to portrait. I want it permanently on landscape =(
29th December 2011, 11:31 PM |#12  
madmack's Avatar
OP Senior Member
Flag Boston, MA
Thanks Meter: 4,762
 
Donate to Me
More
Quote:
Originally Posted by mastermikeywwt

Can't get this to work on my Xperia x8. Soon as I lock the screen it reverts to portrait. I want it permanently on landscape =(

ok, does it switch to landscape temporarily in the beginning and then revert back after a while?

and do you have any task killers/managers?
30th December 2011, 12:15 AM |#13  
warrenis1234's Avatar
Senior Member
Flag Brooklyn
Thanks Meter: 52
 
More
this is amazing. you wanna know why this is amazing? because it even forces landscape for touchwiz. paint me shocked, thank you
30th December 2011, 01:18 AM |#14  
Senior Member
Thanks Meter: 7
 
More
Quote:
Originally Posted by warrenis1234

this is amazing. you wanna know why this is amazing? because it even forces landscape for touchwiz. paint me shocked, thank you

I had high hopes for this as I only downloaded this to force the "Sense" home screens on my HTC Sensation into Landscape. Unfortunally the app doesn't orient it correctly...
30th December 2011, 01:41 AM |#15  
krkeegan's Avatar
Senior Member
Flag Los Angeles
Thanks Meter: 68
 
More
You are the man! Works perfectly. I looked for an app like months ago and found nothing. Not even paid.

I like the non-service aspect. If you have any interest in developing the app further to include a hook for tasker I would certainly pay $1 for that. Maybe as a premium version of the app? ATM it works fine just having tasker launch the app, but being able to set the orientation automatically in certain conditions without user input would be cool too.

Thanks again.

--Edit

The only bummer is I was previously able to lock the orientation in my launcher, Go Launcher, while still having autorotate in all other apps. It looks like this somehow overrides my launcher's ability to lock itself anymore. Kind of a bummer, but I can probably live with that.
30th December 2011, 02:30 AM |#16  
Wiki Admin / Recognized Contributor
Thanks Meter: 1,640
 
More
Works great on the Dell Streak 5/GB. Even the stubborn apps that want to run in portrait only or landscape only seem to be forced to the selected orientation
30th December 2011, 03:14 AM |#17  
behappy's Avatar
Senior Member
Thanks Meter: 27
 
More
Thumbs up
Thumps up. I love the simplicity and how smooth it is. Nice work and thanks!
30th December 2011, 03:31 AM |#18  
Senior Member
Thanks Meter: 12
 
More
Doesn't work in landscape mode for HTC EVO 3D with stock Gingerbread. Keeps trying to load, locks up phone. When I restart it loses all the settings
30th December 2011, 04:08 AM |#19  
madmack's Avatar
OP Senior Member
Flag Boston, MA
Thanks Meter: 4,762
 
Donate to Me
More
Quote:
Originally Posted by dfine1966

Doesn't work in landscape mode for HTC EVO 3D with stock Gingerbread. Keeps trying to load, locks up phone. When I restart it loses all the settings

there are no settings? at the current version, this app will not remember your last rotation setting on reboot. so you'll need to relaunch the app. might add that in future versions

I'm not sure why it's locking up. Does your launcher support landscape mode? if it doesn't then try another launcher that supports it and see how it works. Launcher Pro, Go Launcher and ADW are some of the popular ones and they all support landscape mode.
30th December 2011, 04:25 AM |#20  
madmack's Avatar
OP Senior Member
Flag Boston, MA
Thanks Meter: 4,762
 
Donate to Me
More
v1.1
thanks for your feedback guys.

if you like this app, please do leave a positive feedback on the market given how important the first few comments are


I've updated the OP to v1.1 which introduces a new menu that allows you to long press on Landscape to trigger a persistent background service. This should only be needed on small or low-end devices that are constantly starved of memory.
To disable that service, either click on the added item to the pull-down menu or relaunch the app and select portrait or auto.

You can obviously still run landscape mode without running a background service if you simply click on it without long pressing.
30th December 2011, 04:48 AM |#21  
vua777's Avatar
Senior Member
Thanks Meter: 94
 
More
see from portal, good app
30th December 2011, 05:46 AM |#22  
Wiki Admin / Recognized Contributor
Thanks Meter: 1,640
 
More
Mind if I bundle Rotation Locker into a rom I'm making? I'll provide proper credits of course.

I currently have no third-party apps in it, but I'm really tempted to make just one exception as rotation is a really sticky issue on the streak. If I were to include only a single third party app, it would be this one. (you can quote me on that)
30th December 2011, 05:50 AM |#23  
madmack's Avatar
OP Senior Member
Flag Boston, MA
Thanks Meter: 4,762
 
Donate to Me
More
Quote:
Originally Posted by TheManii

Mind if I bundle Rotation Locker into a rom I'm making? I'll provide proper credits of course.

I currently have no third-party apps in it, but I'm really tempted to make just one exception as rotation is a really sticky issue on the streak. If I were to include only a single third party app, it would be this one. (you can quote me on that)

I don't mind that at all thanks for letting me know.
30th December 2011, 06:04 AM |#24  
Wiki Admin / Recognized Contributor
Thanks Meter: 1,640
 
More
Can I ask how rotation locker does its thing?

I dont wanna go though the effort of decompiling it to learn, I'm not gonna add it to my rom/steal anything, I'm just genuinely curious.

Could I make a feature request?
Make a toggle button of some kind available: HC has the same feature, it's an on/off button that when turned off, locks it to the current orientation.

It wouldnt be too much more useful currently if it were swapped with a toggle button, but if there is an approporate place where it would be applicable, could you add it?
30th December 2011, 06:24 AM |#25  
Junior Member
Flag Melbourne
Thanks Meter: 1
 
More
Interesting concept, this will be very handy.
It works well with some apps, but strange with the home screen (stock sensation XE), it's like a fight between Sense and Rotation Locker. It tries to load several times, reverting to a blank screen between each try until Sense force closes.

Still nice however! Good job.



Sent from my HTC Sensation XE with Beats Audio Z715e using XDA App
30th December 2011, 09:25 AM |#26  
pakino2004's Avatar
Senior Member
Gran Canaria
Thanks Meter: 79
 
More
Smile dell streak
hello
i like yor app and works great on my galaxy note but on my streak isnt work.
I think the problem ist that the streak has as default landscape mode. Iwould really appreaciate if you can do a special one for the streak owners
thanx in advance
Pakino
30th December 2011, 11:18 AM |#27  
Senior Member
Thanks Meter: 42
 
More
Thanks a lot ! I have been looking for this for quite some time

It is working just fine on the Galaxy Note, we still need a quick way to access it

EDIT: not showing in the ongoing though
30th December 2011, 12:50 PM |#28  
laneyofdeath's Avatar
Senior Member
Flag Manchester
Thanks Meter: 330
 
More
Nice works perfect on x10i

Sent from my X10i using XDA App
30th December 2011, 01:59 PM |#29  
xperiax10.awesome's Avatar
Recognized Contributor
Flag Singapore
Thanks Meter: 1,461
 
Donate to Me
More
ORIENTATION CONTROL has more options like Reverse Portrait n Reverse Landscape.

Sent from my Sony Tablet S using xda premium
30th December 2011, 02:07 PM |#30  
Junior Member
Thanks Meter: 0
 
More
HELP!

I tried the rotation locker on my dell strek 5, and It blocked the screen in portrait mode even if I removed the app!!!!!

now every app is in landscape!!!!!!
30th December 2011, 03:38 PM |#31  
Retired Recognized Developer
Thanks Meter: 8
 
More
Very useful app and works great on SGS2 I always thought auto-rotation is a broken concept, manual rotation like Rotation Locker is the way to go!

+1 for the request to add a "toggle orientation" shortcut - to quickly change the orientation with no GUI. Once we set up the app, we would never need to use any other option but the toggle.

Also - it would be nice if manually activating the phone's "Auto Rotation" option would disable the rotation lock.
30th December 2011, 04:08 PM |#32  
madmack's Avatar
OP Senior Member
Flag Boston, MA
Thanks Meter: 4,762
 
Donate to Me
More
Quote:
Originally Posted by TheManii

Can I ask how rotation locker does its thing?

I dont wanna go though the effort of decompiling it to learn, I'm not gonna add it to my rom/steal anything, I'm just genuinely curious.

Could I make a feature request?
Make a toggle button of some kind available: HC has the same feature, it's an on/off button that when turned off, locks it to the current orientation.

It wouldnt be too much more useful currently if it were swapped with a toggle button, but if there is an approporate place where it would be applicable, could you add it?

Well, most apps in the market manually override an Android Settings integer to enforce portrait or auto rotate. This guy doesn't accept landscape as a parameter. The only way to work around this is to run a service (even temporarily) and have that service create and enforce a landscape view I won't say more or give anymore details given the time it took me to figure it out and after all, I want my app to standout

The on/off button. is that a widget? so basically if you're in auto-rotate, and you flip the phone to landscape, the toggle would lock landscape mode and when unchecked it'll go back to autorotate kinda thing?

Quote:
Originally Posted by unl0rd

Interesting concept, this will be very handy.
It works well with some apps, but strange with the home screen (stock sensation XE), it's like a fight between Sense and Rotation Locker. It tries to load several times, reverting to a blank screen between each try until Sense force closes.

Still nice however! Good job.



Sent from my HTC Sensation XE with Beats Audio Z715e using XDA App

speaks volumes about the HTC Sense home screen implementation I guess your best bet is to use another home screen.

Quote:
Originally Posted by xperiax10.awesome

ORIENTATION CONTROL has more options like Reverse Portrait n Reverse Landscape.

Sent from my Sony Tablet S using xda premium

I can implement these as well, but I don't find them useful, at least for me. Besides, these other modes only work on higher Android versions (Gingerbread >).

Quote:
Originally Posted by mrmarco

HELP!

I tried the rotation locker on my dell strek 5, and It blocked the screen in portrait mode even if I removed the app!!!!!

now every app is in landscape!!!!!!

You'll probably need to enable autorotate from android settings. it's listed under "Display".
30th December 2011, 10:49 PM |#33  
salisbury_steak's Avatar
Senior Member
Flag Manila
Thanks Meter: 665
 
More
Confirmed working on the O2X. Thanks for releasing your app free mate. Really appreciate it. You deserve 5 stars...
The Following User Says Thank You to salisbury_steak For This Useful Post: [ View ] Gift salisbury_steak Ad-Free
31st December 2011, 04:34 AM |#34  
Member
Flag Lanaudiere, Quebec
Thanks Meter: 4
 
More
Works great on my Galaxy S2 x (t989d) with Go Launcher Ex.. exept for the Go Locker plugin.. If you can modify your app to switch the lock screen (even the stock one), it would be great!!

31st December 2011, 07:24 AM |#35  
Senior Member
Thanks Meter: 23
 
More
I've been looking for this for quite a while now, so thanks!

Interesting that the auto-rotate setting forces auto-rotate for everything, even apps that normally lock themselves into one orientation. Is there a way (besides stopping the process manually) to switch back to the stock Android version of auto-rotate that lets some apps force their orientation? Could you add a fourth option to the menu that does that? I could see myself using both your version of auto-rotate, and Android's version, in addition to your portrait and landscape locks.
31st December 2011, 08:37 AM |#36  
Senior Member
Flag Slovenj Gradec
Thanks Meter: 766
 
More
Nice app!
Working perfectly on my Wildfire.

Quote:
Originally Posted by trdcameleon

Works great on my Galaxy S2 x (t989d) with Go Launcher Ex.. exept for the Go Locker plugin.. If you can modify your app to switch the lock screen (even the stock one), it would be great!!

GO Locker goes into landscape for me.
31st December 2011, 12:12 PM |#37  
Member
Flag Lanaudiere, Quebec
Thanks Meter: 4
 
More
Quote:
Originally Posted by nejc121

Nice app!
Working perfectly on my Wildfire.



GO Locker goes into landscape for me.

It works for me too..that was because i used custom background with go locker..

Sent from my SGH-T989D using xda premium
31st December 2011, 12:58 PM |#38  
madmack's Avatar
OP Senior Member
Flag Boston, MA
Thanks Meter: 4,762
 
Donate to Me
More
Quote:
Originally Posted by rjax

I've been looking for this for quite a while now, so thanks!

Interesting that the auto-rotate setting forces auto-rotate for everything, even apps that normally lock themselves into one orientation. Is there a way (besides stopping the process manually) to switch back to the stock Android version of auto-rotate that lets some apps force their orientation? Could you add a fourth option to the menu that does that? I could see myself using both your version of auto-rotate, and Android's version, in addition to your portrait and landscape locks.

Auto or Portrait are really just the default android settings that you toggle from the Display settings. Set the app to either of these and apps that force a certain orientation will retain their setup.

the whole issue of landscape is a tricky one. Android treats portrait as default and leaves the landscape implementation as optional so some apps do without it (e.g. the default android lockscreen). I can't change the behavior or implement missing orientations in these apps so yea, you'll need to revert to one of the default options in android to get their normal interfaces back. that is, by selecting either portrait or auto.
31st December 2011, 04:33 PM |#39  
Senior Member
Thanks Meter: 23
 
More
Quote:
Originally Posted by madmack

Auto or Portrait are really just the default android settings that you toggle from the Display settings. Set the app to either of these and apps that force a certain orientation will retain their setup.

the whole issue of landscape is a tricky one. Android treats portrait as default and leaves the landscape implementation as optional so some apps do without it (e.g. the default android lockscreen). I can't change the behavior or implement missing orientations in these apps so yea, you'll need to revert to one of the default options in android to get their normal interfaces back. that is, by selecting either portrait or auto.

On my first use of the app, I definitely expected "Auto" to be the as same going back to normal auto-rotate, but that's not what I observed. Instead, for the limited apps I have installed that do force orientation, each app except for the stock lock screen all rotate when I physically shift between portrait and landscape.

Additionally, I actually expected your "Portrait" to be different than having the auto-rotate option unchecked in Android (i.e. that your Portrait setting would force Portrait on apps that are normally landscape-only), and Rotation Locker does behave as I expected here. (But different than you intended?)

So I'm wondering if there's something different on my phone (Galaxy Nexus rooted, but still stock CDMA 4.0.2, and not a whole lot of apps installed) compared to where you did your development.

Let me know if there are any particular scenarios you'd like me to run through to maybe give you a better understanding of what's going on.

One thing that may be of interest to you is that the behavior of my one normally-landscape-only app changes depending on when I switch settings. If the app is already running when I switch to portrait in Rotation Locker, the app occupies the top half the screen in the proper aspect ratio, but with its right side cut off and black space on the bottom half. However, if I'm already in portrait and I start the app up, it stretches to fit the portrait screen in a distorted aspect ratio.

And I should emphasize, it's easy enough for me to go into settings and kill Rotation Locker to restore Android's default behavior, but it would be nice for new users not to have to go through this process of figuring out to return to "normal" behavior.
31st December 2011, 04:42 PM |#40  
Senior Member
Thanks Meter: 260
 
More
awesome
have you thought about adding your code to cyanogenmod so it can be build into the ROM?
The Following User Says Thank You to punshkin For This Useful Post: [ View ] Gift punshkin Ad-Free
31st December 2011, 05:41 PM |#41  
Senior Member
Flag Slovenj Gradec
Thanks Meter: 766
 
More
I have an idea for this app. Enable it to launch by long-pressing the search button (Like Voice Search, messaging apps), so that way you can launch it from almost any app
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes