question

androiddev avatar image
androiddev asked lilluunk commented

Get current location ZIP code.

Hi,

How can I get current ZIP code of device location?

Take in mind that device can travel and location often changes.

Clover Android SDKclover developer community
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered lilluunk commented

Only some Clover devices have location services (such as Flex) but it's GPS-based only (not AGPS). It's only going to work in locations where the device has a clear view of the sky. Even if you did have the lat / long, you'd need to subscribe to a service that could map that to a zip code.

If you are writing an app here that needs to know this, you could do something like keep a mapping of wifi SSID to zip code, and if it's unknown, ask the user and remember it. Sync this data between devices so once it's known on one device it's known to all. Just an idea.

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

androiddev avatar image androiddev commented ·

Clear. Thank you, Jeffrey!

0 Likes 0 ·
lilluunk avatar image lilluunk androiddev commented ·

It's really helpful to see all the solutions for retrieving the current location zip code! While we’re discussing geo-specific features, if any of you are thinking about leveraging such tools for travel or local deals, knowing when to travel can also save a lot on expenses. For example, I found Las Vegas to be surprisingly affordable during certain times of the year. There’s a great article at https://www.travelwiseway.com/section-tips/budget-trips/article-the-cheapest-time-to-visit-vegas-see-las-vegas-without-going-broke-03-12-2023.html that outlines the cheapest times to visit Vegas, which allowed me to enjoy the city without stretching my budget too thin. It could be a cool integration for apps focused on travel deals or budget planning.

0 Likes 0 ·

Welcome to the
Clover Developer Community