cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LuisRibeirinho
Level: Powered On

Get device orientation

Hi,

 

I'm building an App for site inspection and the main goal is to automate the production of reports. So it is important that all photos are landscape. Is there a way to retrieve the device orientation to block the user to take portrait photos?

2 ACCEPTED SOLUTIONS

Accepted Solutions
PowerApps Staff AndyPennell
PowerApps Staff

Re: Get device orientation

There is no way to detect the device orientation, unfortunately.

ocalaf-mediapro
Level: Powered On

Re: Get device orientation

Maybe it's not needed for that particular case, we could just "calculate it" knowing and keeping the width and heigh updated. Something like this seems to work perfectly!

 

responsive_orientation.pngOrientation using responsive heigh-width

Just keep in mind that at this point this is only available using a preview environment, check this other post to set it up and start testing responsive design in powerapps!

5 REPLIES 5
VincentM
Level: Powered On

Re: Get device orientation

Nothing will ever stop a user from turning their phone upside down to take a picture, but you can lock the screen orientation in the app settings in the file menu.

LuisRibeirinho
Level: Powered On

Re: Get device orientation

Thanks for the quick reply.

 

My ideia was to collect the photo only if the position was set correctly and to set a textbox visible allerting the user, if it was not. The screen orientation is already locked.

PowerApps Staff AndyPennell
PowerApps Staff

Re: Get device orientation

There is no way to detect the device orientation, unfortunately.

Highlighted
ocalaf-mediapro
Level: Powered On

Re: Get device orientation

It would be very nice pushing back this idea now that resposive design is starting to become a reality since last preview release.
ocalaf-mediapro
Level: Powered On

Re: Get device orientation

Maybe it's not needed for that particular case, we could just "calculate it" knowing and keeping the width and heigh updated. Something like this seems to work perfectly!

 

responsive_orientation.pngOrientation using responsive heigh-width

Just keep in mind that at this point this is only available using a preview environment, check this other post to set it up and start testing responsive design in powerapps!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 270 members 4,396 guests
Please welcome our newest community members: