Package 

Class WifiManager


  • 
    public final class WifiManager
    
                        

    Manager class for WiFi scanning and data collection using a simplified dual-timer approach.

    Strategy:

    • Android 9+ (API 28+): Uses WifiScanner with low-latency settings for optimal performance (when available)

    • Android 8 and below: Uses traditional WifiManager with dual-timer approach

    For Android 9+ (when WifiScanner is available):

    • WifiScanner with SCAN_TYPE_LOW_LATENCY for real-time scanning

    • Continuous scan results without throttling limitations

    For older versions or when WifiScanner is not available:

    • Legitimate scan requests every 30 seconds (respects Android throttling)

    • System scan result checks every 1 second (no throttling limits)

    • Method Detail

      • startUpdates

         final Unit startUpdates()

        Start WiFi scanning and data collection.

      • stopUpdates

         final Unit stopUpdates()

        Stop WiFi scanning and data collection.

      • setAggressiveScanning

         final Unit setAggressiveScanning(Boolean enabled)

        Enable or disable aggressive scanning mode. Aggressive mode uses 1-second legitimate scan requests (requires throttling disabled). Conservative mode uses 30-second legitimate scans + 1-second system checks.

      • setUltraFastMode

         final Unit setUltraFastMode(Boolean enabled)

        Enable or disable ultra-fast mode. Ultra-fast mode ignores cache and submits every single scan result for maximum data freshness. This provides the absolute fastest data collection but uses more resources.

      • enableMaximumSpeedMode

         final Unit enableMaximumSpeedMode()

        Enable maximum speed WiFi data collection. This combines aggressive scanning (500ms intervals) + ultra-fast mode (no cache). Perfect for devices with throttling disabled that need the fastest possible data.