green-code-initiative / ecoCode-android

Reduce the environmental footprint of your Java-based Android apps with SonarQube
https://ecocode.io
GNU General Public License v3.0
54 stars 17 forks source link

[iOS] Sobriety - Thrifty Geolocation (ESOB002) #45

Closed Pierre-CGI closed 1 year ago

Pierre-CGI commented 1 year ago

Location awareness is one of the most popular features used by apps. By default standard location updates run with the best accuracy level, but unless your app really needs to know the user’s position within a few meters, this level of accuracy isn't needed. Requesting higher accuracy than you need causes the system to power up additional hardware and waste power for unnecessary precision. You can specify a degree of accuracy by setting the CLLocationManager#desiredAccuracy property. Also, setting the CLLocationManager#activityType property will let the system knows what type of location activity your app is performing and helps it determine the most appropriate time to perform location updates. Finally, if your app just needs a quick fix on the user’s location, it’s best to call the CLLocationManager#requestLocation method, that will deliver a single location update.

zippy1978 commented 1 year ago

Addressed by https://github.com/green-code-initiative/ecoCode-mobile/pull/59