Landscape or Portrait orientation detection?

I did use search even googled it but i find topics that does not answer my question directly
I know for preview in browser i can’t force some orientation
BUT i can check if width of camera is greater than height or vice-versa
To decide how to change camera zoom and other stuff

BUT is there away to allow orientation change for exported APK games?
Like right now its locked in orientation i set in project properties
And how to allow it to change orientation based on phone orientation?
Same as i would get it if i play preview in browser on my phone
Is using device sensor my only option then?