I'd like to install some software (willing to write it myself if necessary) on Android devices which will restrict them from rotating to particular orientations.
There are plenty of apps that will lock a particular orientation, but what I would like to do is say (for example) you are allowed any orientation but not reverse portrait.
How can I achieve this?