Skip to content

Conversation

@sebastinto
Copy link
Contributor

Summary

This PR adds a new location command that retrieves and displays details about the user's current geographic location using Android's location services.

Key Features

  • Location Retrieval: Uses GPS and/or network providers to get current location with automatic fallback between providers.
  • Fresh Updates: location -refresh flag forces a new GPS location request, bypassing and refreshing cache.
  • Comprehensive Details: Shows latitude, longitude, accuracy, source (GPS/network, cached/fresh), and location age.
  • Permission Handling: Requests location permissions when needed.
  • Internationalization: Full support for existing languages.

Examples: location, location -refresh

Testing

Comprehensive unit test coverage was added + manual testing performed.

Screenshot_20251005_150725 Screenshot_20251005_150746 Screenshot_20251005_103701

@sebastinto sebastinto mentioned this pull request Oct 5, 2025
@sebastinto
Copy link
Contributor Author

Have you had time to look at this @coderGtm ?

@coderGtm
Copy link
Owner

I forgot to put a comment earlier 😞. I wanted to know why don't we always use the fresh location instead of the cached version?

I mean if a user is using this command, they want to know their current location and if they already know it (cached), why would they need to use the command?

I might be missing something so wanted to know your thought process behind it.

@sebastinto
Copy link
Contributor Author

sebastinto commented Oct 14, 2025

I forgot to put a comment earlier 😞. I wanted to know why don't we always use the fresh location instead of the cached version?

We could but it uses more battery so the best practice is fetching the cached location. The cached locations is supposed to update "intelligently" based on heuristics so the expectation is that most of the time the cached location will be accurate / current.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants