Blog
GPS - 3 Frequent Questions about Location Services
January 15. 2021
Help - my app isn't picking up correct location/GPS values! If the location features aren't working, it might be due to these reasons that I most commonly see.
The ability to retrieve the user location in a canvas app is a great feature that opens up many possibilities.
However, this feature can raise some questions and here are 3 that I commonly see.
1. The longitude or latitude values return nothing, or returns zero valuesÂ
The most common question is that the location signal does not a return value, or that it returns 0 longitude and latitude values. The typical cause of this is that the location signal is disabled.
Power Apps disables the location signal when it detects that it isn't in active use. This is good behaviour because it helps preserve the battery life of a mobile device. However, it can be very confusing when the location signal stops working as expected.
Power Apps disables the location signal when it detects that it isn't in active use. This is good behaviour because it helps preserve the battery life of a mobile device. However, it can be very confusing when the location signal stops working as expected.
The fix for this is to to re-enable the location signal on the screen where we want to retrieve location values. We can do this by calling the Enable function in the OnVisible property of the screen like so.
Enable(Location)
The help for the Enable function is here:
2. The longitude or latitude values are not accurate
A second common question issue relates to the accuracy of the location readings. App builders sometimes report that the location readings are not as accurate as they expect.
Usually, the reason for this is because the settings of the device have not been set up to return location readings with "high accuracy".
On an Android device for example, we can fix this through the Settings > Location menu item. Here, we can find the settings that determine the accuracy of the location that the device returns.
3. Can I build an app that tracks the activity of a user?
The third frequent question I see is more of a general question. App builders often ask whether it's possible to build an app that tracks the activity of users. For example, an app that can track the location of a delivery driver throughout the day, or a health-related app that can track the time and route of a run.
In practice, Power Apps is not well-suited for these use case scenarios. The reason for this is because it can only capture location data when the app runs in the foreground. When a device becomes inactive and the screen switches off, the app suspends execution and will not collect data whilst in this state.
In practice, Power Apps is not well-suited for these use case scenarios. The reason for this is because it can only capture location data when the app runs in the foreground. When a device becomes inactive and the screen switches off, the app suspends execution and will not collect data whilst in this state.
Conclusion
Related posts
- Apps - What happens to canvas apps when the owner/employee leaves an organisation?
- How to work more quickly with Power Apps by creating browser bookmarks
- What languages does Power Apps support, and how to start Power Apps in a different langauge?
- New model driven app designer - a first look
- Learn Power Apps and Dataverse with the free, online 'app in a day' training course
- Themeing - How to apply consistant styles and themes to canvas apps with the CoE theming solution
- Does Power Apps still support Internet Explorer (IE) - 2020?
- How app design will become much easier with the new converged/integrated canvas and model driven app designer
- General - The easiest way to convert phone apps to tablet apps
- Email - How to send email with the Office 365 Outlook connector
- General - How to change the language of Power Apps Studio
- 2021 Release Wave 1 - A review of the upcoming features for April - September 2021
- Settings - Old Layout vs New Layout (2021)
- What to do when some part your app breaks, or starts behaving differently?
- 5 Tips for when you can't sign into Power Apps