Practical examples of setting up location services in mobile apps

If you’re building a modern app, you can’t escape location. Rideshare apps, food delivery, fitness trackers, weather apps—they all rely on knowing *where* the user is. But doing this well is more than just flipping a GPS switch. In this guide, we’ll walk through practical, real-world examples of setting up location services in mobile apps so you can see what actually works in 2024–2025. We’ll look at how popular apps handle permissions, accuracy, battery usage, and privacy, and then translate those patterns into steps you can apply in your own project. Along the way, you’ll see examples of setting up location services in mobile apps for iOS and Android, from simple “show my nearest store” features to background tracking for delivery drivers. Whether you’re a beginner shipping your first app or a product manager trying to understand what to ask your dev team for, you’ll leave with a clear, practical blueprint.
Written by
Taylor
Published

Real-world examples of setting up location services in mobile apps

Let’s start with the fun part: how real apps do this in the wild. Seeing concrete examples of setting up location services in mobile apps makes it much easier to design your own flow.

Think about these scenarios:

  • A rideshare app like Uber or Lyft asking for precise location when you open the map so it can drop a pin where you’re standing.
  • A food delivery app using background location so the customer can watch the courier drive toward their house.
  • A weather app asking for approximate location so it can show local forecasts without needing your exact address.
  • A retail app (Target, Walmart, etc.) asking for location only when you tap “Find a store near me.”
  • A running app like Strava or Nike Run Club starting precise, continuous GPS tracking only when you hit “Start Run.”
  • A check‑in or loyalty app using geofencing to remind you to scan your card when you walk into a partner store.

Each of these is an example of setting up location services in mobile apps with a different mix of precision, timing, and user consent. Your job is to pick the pattern that matches your use case instead of blindly copying the most aggressive one.


Best examples of setting up location services in mobile apps by use case

You don’t need to reinvent the wheel. The best examples of setting up location services in mobile apps tend to fall into a handful of repeatable patterns.

On‑demand location: “Only when I tap the button”

This is the friendliest pattern for users and usually the easiest to implement.

Real example: A store finder screen in a retail app. When the user taps “Use my location,” you:

  • Trigger the system permission prompt (if not already granted).
  • Request foreground location only.
  • Fetch a single location fix.
  • Call your API to return nearby stores.

This pattern works well for:

  • Store locators
  • One‑time address suggestions (e.g., “Use current location” in a checkout form)
  • Local news or local offers

It’s a great starter example of setting up location services in mobile apps because it keeps things simple: no background tracking, no constant updates, and an easy explanation to the user.

Continuous tracking while the app is open

Here the app keeps updating the user’s location only while it’s in the foreground.

Real example: A map or navigation view in a transit app. Once the user opens the map:

  • You request foreground location with high accuracy.
  • Subscribe to location updates at a reasonable interval (for example, every few seconds while moving).
  • Stop updates as soon as the user leaves the map or closes the app.

This is common in:

  • Public transit apps
  • Scooter/bike sharing apps when the map is open
  • Hiking or basic navigation apps

This is one of the best examples of setting up location services in mobile apps when you care about battery life but still need a live location while the user is actively engaged.

Background tracking for logistics and delivery

This is where things get serious. Background tracking is heavily scrutinized by both Apple and Google, and users are more wary of it.

Real example: A courier app used by delivery drivers.

In this pattern, the app:

  • Requests background location with a clear, honest explanation of why it’s needed.
  • Starts a background location service when the driver starts a shift or accepts a job.
  • Sends periodic location updates to the server so customers can track their orders.
  • Stops background tracking immediately when the job or shift ends.

If you’re looking for examples of setting up location services in mobile apps that must run reliably all day, look at delivery and workforce management apps. They typically:

  • Use lower‑frequency updates when the user isn’t moving much.
  • Increase frequency only when near pickup/drop‑off points.
  • Provide a persistent notification on Android so users know they’re being tracked.

Privacy‑first, approximate location only

Not every app needs to know the user’s exact doorstep.

Real example: A weather app that just needs the user’s city or neighborhood.

Here, the app:

  • Requests approximate or coarse location instead of precise.
  • Explains that it doesn’t track exact movements, only general area.
  • Uses the city‑level location to fetch local forecasts.

This pattern is especially relevant in 2024–2025 as both Apple and Google promote privacy‑protective defaults. It’s a smart example of setting up location services in mobile apps that want to earn trust and reduce friction in the permission prompt.

Geofencing for reminders and check‑ins

Geofencing lets you define virtual boundaries around real‑world places.

Real example: A loyalty app that reminds you to scan your card when you enter a partner store.

The app:

  • Requests foreground or background location depending on whether reminders should work when the app is closed.
  • Registers geofences (e.g., a 300‑foot radius around store coordinates).
  • Listens for enter/exit events and triggers notifications.

Geofencing is a subtle but powerful example of setting up location services in mobile apps that don’t need constant GPS tracking but still want location‑aware behavior.

Health and fitness tracking

Running, cycling, and hiking apps often combine several patterns:

  • Foreground, precise tracking during a workout.
  • Occasional background tracking if the screen is off but the workout is still running.
  • Geofenced segments (for example, Strava segments) to detect when you pass specific routes.

If you want real examples of setting up location services in mobile apps that balance accuracy with battery drain, fitness apps are a gold mine.

For general guidance on location and physical activity data handling, you can also look at privacy guidance from organizations like the Federal Trade Commission and health‑related privacy recommendations from NIH when your app touches health‑adjacent data.


Platform‑specific examples: iOS vs. Android in 2024–2025

The core ideas are the same on both platforms—ask for permission, explain why, and use the minimum access you need—but the details differ.

iOS examples of setting up location services in mobile apps

On iOS, users are used to seeing options like:

  • Allow Once
  • Allow While Using the App
  • Don’t Allow

And for some apps, they’ll later see a separate prompt asking for Always Allow if you need background location.

A clean example of setting up location services in a mobile iOS app looks like this:

  • Show an in‑app “pre‑prompt” screen explaining why you need location and how it benefits the user.
  • Request When In Use permission first; don’t jump straight to Always unless your app is literally unusable without it.
  • Use the new iOS options for Precise vs. Approximate location, and default to approximate when that’s enough.
  • Respect the user’s choice. If they pick approximate or “While Using,” don’t keep nagging them to upgrade unless there’s a clear, honest reason.

Apple publishes detailed guidance for developers in its Location and Maps Programming Guide, which is worth a read if you’re designing your own flow.

Android examples of setting up location services in mobile apps

Android has become more privacy‑aware in recent versions, especially Android 12 and up. Users now regularly see prompts for:

  • Approximate vs. Precise location
  • Allow only while using the app
  • Ask every time

A good Android example of setting up location services in mobile apps in 2024–2025 includes:

  • Requesting location permission at the moment of need, not on first launch.
  • Requesting foreground and background permissions separately, with clear copy.
  • Showing a persistent notification when background location is active.
  • Using the Fused Location Provider for better battery usage rather than raw GPS all the time.

Google’s developer docs on Location are a helpful reference for implementation details and current policy expectations.


Designing the user flow: from first launch to ongoing use

Now let’s stitch these examples into a practical flow you can adapt.

Step 1: Decide the minimum access you truly need

Before writing any code, ask:

  • Do I need exact GPS coordinates, or will city‑level be fine?
  • Do I need the user’s location when the app is closed, or only when a feature is open?
  • Can I offer a partial experience without location at all?

This is where those earlier examples of setting up location services in mobile apps help you choose the right pattern instead of over‑requesting.

Step 2: Explain the “why” in plain language

Users say yes more often when they understand the benefit.

Instead of a vague message like:

“This app needs your location.”

Try something like:

“We use your location to show nearby stores and local deals. We never sell your location data.”

Or for a delivery driver app:

“We use your location in the background so customers and dispatch can see where you are during active deliveries.”

You can find general privacy communication tips from sources like the U.S. Federal Communications Commission and NIST, which both encourage clear, human‑readable explanations.

Step 3: Ask at the moment of need

Instead of asking for location the second the app opens, wait until the user does something that obviously requires it:

  • Opening the map
  • Tapping “Find nearby”
  • Starting a workout

This pattern shows up in many of the best examples of setting up location services in mobile apps because it feels logical and less intrusive.

Step 4: Handle “No” gracefully

Users will say no. Plan for it.

Good apps:

  • Offer a manual alternative (type a city or ZIP code instead of using GPS).
  • Show a friendly, one‑time explanation if a feature won’t work without location.
  • Provide a clear path to turn permissions back on later via Settings.

Poor apps just crash or show blank screens. Don’t be that app.

Step 5: Monitor battery and performance

Location is one of the biggest battery hogs on a phone. To keep users happy:

  • Use high‑accuracy (GPS) only when truly needed.
  • Fall back to Wi‑Fi/cell‑based location for less demanding tasks.
  • Reduce update frequency when the user isn’t moving.

Many real examples of setting up location services in mobile apps—especially logistics and fitness—use adaptive strategies like “high accuracy during active trips, lower accuracy between trips.”


Privacy, policy, and user trust in 2024–2025

Regulators and platforms are paying more attention to location data. If your app mishandles it, you risk store rejection, bad reviews, or worse.

Key points to keep in mind:

  • Be transparent in your privacy policy about what location data you collect, how long you keep it, and who you share it with.
  • Offer users meaningful choices, like turning off background tracking or deleting history.
  • For health‑adjacent apps (fitness, pregnancy tracking, etc.), consider guidance from organizations like Mayo Clinic and CDC on sensitive health information, and treat location around clinics or hospitals with extra care.

The strongest, real‑world examples of setting up location services in mobile apps combine good UX with clear privacy boundaries. Over time, that’s what keeps users from uninstalling.


FAQ: examples of setting up location services in mobile apps

Q: Can you give a simple example of setting up location services in a mobile app for beginners?
A: A classic beginner‑friendly example of setting up location services in mobile apps is a store locator. You show a “Use my location” button, request foreground permission when tapped, fetch a single location fix, and call your backend for nearby stores. No background tracking, no geofences—just a one‑time lookup.

Q: What are some best examples of apps that use background location responsibly?
A: Delivery driver apps, workforce tracking apps, and serious fitness apps often provide good real examples of setting up location services in mobile apps with background access. They explain why they need it, show persistent indicators, and stop tracking when a job or workout ends.

Q: How do I handle users who deny location permission?
A: Offer a fallback when possible (typing an address instead of using GPS) and explain what they’re missing in a single, clear message. Many examples of setting up location services in mobile apps show a short banner like, “Turn on location to automatically find nearby restaurants,” with a button that takes the user to Settings.

Q: Should my app use precise or approximate location?
A: Use approximate whenever it still lets you deliver the value you promise. For weather, news, and basic local content, approximate is usually fine. Save precise location for navigation, delivery tracking, and workouts—those are the best examples of setting up location services in mobile apps that truly need exact coordinates.

Q: How often should I update the user’s location?
A: Match the update rate to the task. Navigation and live delivery tracking may need updates every few seconds, while geofencing or local offers can rely on much less frequent updates. Many real examples of setting up location services in mobile apps adapt dynamically: fast updates while actively navigating, slower updates when idle.

Explore More Mobile App User Guides

Discover more examples and insights in this category.

View All Mobile App User Guides