Looking at the AndroidManifest.xml (link), on line 9:
<activity android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:name="VncCanvasActivity">
This line specifies the screenOrientation
as landscape, but author goes further in overriding any screen orientation changes with configChanges="orientation|keyboardHidden"
. This points to a overridden function in VncCanvasActivity.java.
If you look at VncCanvasActivity, on line 109 is the overrided function:
@Override
public void onConfigurationChanged(Configuration newConfig) {
// ignore orientation/keyboard change
super.onConfigurationChanged(newConfig);
}
The author specifically put a comment to ignore any keyboard or orientation changes.
If you want to change this, you can go back to the AndroidManifest.xml file shown above, and change the line to:
<activity android:screenOrientation="sensor" android:name="VncCanvasActivity">
This should change the program to switch from portrait to landscape when the user rotates the device.
This may work, but might mess up how the GUI looks, depending on how the layout were created. You will have to account for that. Also, depending on how the activities are coded, you may notice that when screen orientation is changed, the values that were filled into any input boxes disappear. This also may have to be handled.
Best Answer
Here's a good way using resources and size qualifiers.
Put this bool resource in res/values as bools.xml or whatever (file names don't matter here):
Put this one in res/values-sw600dp and res/values-xlarge:
See this supplemental answer for help adding these directories and files in Android Studio.
Then, in the onCreate method of your Activities you can do this:
Devices that are more than 600 dp in the smallest width direction, or x-large on pre-Android 3.2 devices (tablets, basically) will behave like normal, based on sensor and user-locked rotation, etc. Everything else (phones, pretty much) will be portrait only.