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
Power Apps Staff AndyPennell
Power Apps Staff

Re: Get device orientation

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

View solution in original post

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!

View solution in original post

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.

Power Apps Staff AndyPennell
Power Apps Staff

Re: Get device orientation

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

View solution in original post

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!

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (1,803)