Skip to content

Instantly share code, notes, and snippets.

@rhonyabdullah
Last active March 12, 2026 07:11
Show Gist options
  • Select an option

  • Save rhonyabdullah/67502844c1743df848ac9ccf1ac2ea6a to your computer and use it in GitHub Desktop.

Select an option

Save rhonyabdullah/67502844c1743df848ac9ccf1ac2ea6a to your computer and use it in GitHub Desktop.
BitRadar - Key Learnings & Insights

BitRadar - Key Learnings & Insights

BitRadar is a powerful Android application designed to monitor and visualize your device's connectivity environment. It provides real-time insights into cellular networks, Wi-Fi connections, and Bluetooth device density, helping users understand their surrounding signal landscape and potential interference.


Key Learnings & Insights

  • Android API Documentation

    • Learned how to read and utilize required classes from the official Android developer documentation.
    • Gained experience navigating the API reference to find relevant methods, constants, and usage patterns.
  • TelephonyManager & Signal Strength

    • Implemented observeCellularStatus flow using TelephonyManager.
    • Handled different Android versions by:
      • Using TelephonyCallback for API 31+.
      • Falling back to PhoneStateListener for legacy APIs.
    • Discovered that dbm values are always negative (β‰ˆ ‑120 to ‑50) and must be normalized for UI display, where values closer to 0 indicate stronger signal strength.
  • Wi-Fi Connectivity & State Caching

    • Built an event-driven callbackFlow with ConnectivityManager.NetworkCallback.
    • Securely extracted Wi-Fi details and IPv4 addresses via NetworkCapabilities and LinkProperties.
    • Key insight: Avoided synchronous calls (e.g., getLinkProperties()) inside callbacks to prevent race conditions and null data.
    • Instead, cached the properties supplied by the OS through onCapabilitiesChanged and onLinkPropertiesChanged.
  • Bluetooth LE Scanning & Permissions

    • Implemented real-time Bluetooth device scanning using BluetoothLeScanner via callbackFlow.
    • Managed complex permission requirements across Android versions:
      • Added legacy BLUETOOTH and BLUETOOTH_ADMIN manifest flags for Android 11 and below.
      • Used BLUETOOTH_SCAN dynamically for Android 12+.
    • Handled the volatile nature of BLE scans by mapping devices by MAC address (Map<String, Pair<BluetoothDevice, Long>>) to avoid duplicates.
    • Developed a "device aging" system that compares timestamps (System.currentTimeMillis()) inside a coroutine polling loop to remove inactive devices that haven't been seen in the last 10 seconds.
  • Permission Handling & Rationale Strategy

    • Designed a granular permission request system with specialized rationale dialogs (PermissionRationaleDialog) for Cellular, Wi-Fi, and Bluetooth, integrating directly within individual component cards.
    • Used Accompanist's permissions library to manage MultiplePermissionsState, properly distinguishing between first-time requests, rationale needs, and permanent denials (guiding users to App Settings).
    • Adopted the principle of least privilege by pruning unnecessary permissions (like READ_PHONE_STATE) to match exact API requirements.
  • Adaptive Layouts with WindowSizeClass

    • Upgraded from manual screen width calculations (BoxWithConstraints) to the official WindowSizeClass API (androidx.compose.material3:material3-window-size-class).
    • Implemented calculateWindowSizeClass() at the root activity level and passed down WindowWidthSizeClass configurations to Composable screens.
    • Successfully mapped WindowWidthSizeClass.Compact to mobile layouts and larger size classes to expanded adaptive tablet layouts, improving rendering predictability and matching Material 3 guidelines.
  • Firebase Integration & Security

    • Discovered that integrating Firebase libraries (like Crashlytics and Analytics) automatically merges the INTERNET permission into the final manifest, requiring no manual declaration.
    • Security Best Practice: After creating a Firebase project, secured the infrastructure by navigating to the Google Cloud Console and explicitly disabling all unused Google APIs.
    • Enforced strict credential restrictions by binding API keys specifically to the app's Android application ID and restricting usage via SHA-1 signing certificate fingerprints.
  • Google Play Publishing & Closed Testing

    • Managed the Google Play Store deployment from scratch, including creating a new Play Console account and submitting all required legal documentation.
    • Learned that account verification from Google Play can take more than 1 working day.
    • Navigated stricter app submission requirements, including the mandatory provision of a latest privacy policy.
    • Successfully managed the app's website and landing page by collaborating with AI, including generating app store listing images and drafting the long description.
    • Met the mandatory independent testing requirements: acquiring a minimum of 12 opted-in testers for 14 continuous days (Testing Requirements Guide).
    • Realized that publishing even a simple app involves a strict compliance process and mandatory questionnaires from Google Play before production launch, significantly extending the time to market.
    • Enrolled in the Android Developer Verification Program to become a recognized, verified developer. This is crucial as it's being enforced first in select countries (Brazil, Singapore, Indonesia, and Thailand) ahead of a global rollout.

πŸš€ Join the Early Access

BitRadar is currently in closed testing, and I'd be absolutely thrilled if you'd like to help me test it! If you're interested in joining the testing program, you can find more information and register at the official website: bitradar.ruang.work

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