How does Swiggy, Zomato, or Blinkit show your rider’s live location — even when their app is closed? Let’s decode it .... 1️⃣ Rider’s App (Publisher) The rider’s phone collects GPS coordinates every few seconds using the Fused Location Provider — a smart API that combines GPS, Wi-Fi, and mobile data for accuracy. 2️⃣ Foreground Service Even if the rider minimizes or closes the app, a Foreground Service keeps running with a small notification (e.g., “Tracking your delivery…”). This ensures location updates continue in the background. 3️⃣ Backend Server Every few seconds, the app sends the latest location (lat/lng) to the backend via WebSocket or HTTP. The backend updates Redis (or any fast DB) with the new coordinates and broadcasts them to the customer app. 4️⃣ Customer App (Subscriber) The customer app listens for real-time updates and moves the map marker smoothly using Google Maps SDK and sometimes a Kalman filter to avoid “jumping” effects. 5️⃣ Real-Time Communication Technologies like Socket.IO, Firebase Realtime DB, or MQTT keep both apps in sync — ensuring what you see on screen is only seconds old. 6️⃣ Offline & Optimization If the rider goes offline, the app caches the last few locations and syncs later. To save battery, updates are throttled (like every 5–10 sec instead of every second). 💡 So when you track your biryani or grocery order, you’re actually watching: GPS + Foreground Service + WebSocket + Maps SDK + Redis working perfectly in sync. Don’t follow me if you don’t want more articles like this 😉 #softwareEngineers #coders #backend #startups #jobinterview #TechExplained #AndroidDevelopment #SystemDesign #MobileArchitecture #RealTimeSystems
Will the location service be tracked even if they close the Apps from the Recents ?
New Android Job ready program is live now. Enroll now if you want to learn more advance android concepts. https://thecodingshef.in/master-android.