Kotlin Android Floating Chathead App

Job ID: 39810114

Budget: ₹1,250 – ₹2,500 INR

Project Scope: Native Android Chat-Head Bubble for Live Flutter Ride-Hailing Driver App

We’ve developed and launched a ride-hailing driver app using Flutter, and it is currently live on production. Now, we need to add a native Android-only Kotlin module that provides a persistent, Messenger-style floating chat-head bubble. This bubble will be used by drivers while they are online to display live ride request information, continuously fetch location, and remain accessible above all other apps (e.g., Google Maps).

---

Requirements Overview

App Context

--> The main app is built in Flutter and is currently live.
--> We are now adding a native Kotlin module to handle floating overlay behavior, which is difficult to implement reliably in Flutter across Android versions.
--> The Kotlin module will be integrated via platform channels or service hooks, so it can communicate with the Flutter layer.

---

Features to Implement (Kotlin Module)

1. Floating Bubble / Chat-Head Overlay

--> A persistent, movable chat-head bubble using Android’s `WindowManager` and `TYPE_APPLICATION_OVERLAY`.
--> Should appear automatically when the driver goes online.
--> Floats on top of all apps (including system apps and Maps).
--> Can be dragged freely around the screen.
--> Snaps to the nearest screen edge when released, with smooth physics-based animation.
--> Tapping the bubble expands a small UI panel.

2. Expandable Ride Request View

--> On tap or when a ride request is received, the bubble expands into a UI showing:

--> Pickup location
--> Drop-off location
--> Distance (km)
--> Estimated fare
--> Accept and Reject buttons
--> Compact UI with clean animations using `ConstraintLayout` or `MotionLayout`.
--> Actions (accept/reject) should trigger callbacks to the Flutter app or backend.

3. Draw Over Other Apps Permission

--> On first use, the module must:

--> Prompt for “Draw over other apps” permission.
--> Handle denial, retry, and compatibility across Android 8–15 (API 26–34).
--> Provide fallback or guidance if permission isn’t granted.

4. Continuous Foreground Location Fetching

--> When the bubble is active (i.e., driver is online), a foreground service will:

--> Continuously fetch the driver's GPS location using `FusedLocationProviderClient`.
--> Send periodic updates to the Flutter app or backend.
--> Run reliably in the background, during navigation, and when the screen is off.
--> Optimized for battery efficiency and compliant with Doze mode and OEM battery restrictions.

5. Flutter ↔ Native Integration

--> Kotlin module should integrate cleanly with Flutter using:

--> Platform channels (MethodChannel or EventChannel)
--> Or foreground services, local broadcasts, or pending intents
--> Should listen for:

--> Driver online/offline events
--> Incoming ride requests
--> Should send back:

--> Location updates
--> Ride action results (accept/reject)

6. Lifecycle & Robustness

--> The overlay bubble must:

--> Persist across app minimization, configuration changes, and rotation.
--> Optionally restart after system kill or reboot (based on app needs).
--> Cleanly terminate when driver goes offline or app exits.
--> Foreground notification to keep the service alive in background.

---

Deliverables

--> A standalone Kotlin module for the chat-head bubble system.
--> Includes:

--> Floating icon service
--> Overlay UI (bubble + ride info view)
--> Location tracking service
--> Overlay permission flow
--> Integration hooks for Flutter
--> Clean, well-commented code, with a complete README including:

--> Integration steps into the Flutter project
--> Required permissions and setup
--> Platform channel or service communication setup
--> Optional: Sample method channel bridge from Flutter to start/stop the service

---

Summary

> We have a live Flutter-based ride-hailing driver app, and we're extending it with a native Kotlin overlay module to provide a reliable, persistent floating chat-head bubble. This will support ride request display, live location tracking, and interaction over any foreground app, ensuring smooth driver operations across all supported Android versions (API 26–34). The module must integrate seamlessly with the Flutter app and follow modern Android best practices.