cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Power Apps
Power Apps

Re: Get device orientation

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

View solution in original post

Highlighted
Frequent Visitor

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!

 

Orientation using responsive heigh-widthOrientation 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
Highlighted
Advocate I
Advocate I

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.

Highlighted
Frequent Visitor

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.

Highlighted
Power Apps
Power Apps

Re: Get device orientation

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

View solution in original post

Highlighted
Frequent Visitor

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.
Highlighted
Frequent Visitor

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!

 

Orientation using responsive heigh-widthOrientation 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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (2,217)