Skip to main content
Version: 4.6.1

Android Agent

Overview

Android Agent is a native Android SDK that provides NetFUNNEL traffic control functionality for Android applications. It integrates directly into your Android app code to implement queue management and waiting room functionality, distributing server load and ensuring stable user experience during high-traffic periods.

Key Features

  • Native Android SDK: Direct integration into Android app code with simple API calls
  • Two Control Methods: Choose between Basic Control (entry speed limiting) and Section Control (concurrent user management)
  • Dedicated APIs: Basic Control uses nfStart()/nfStop(), Section Control uses nfStartSection()/nfStopSection()
  • Native Waiting Rooms: WebView-based waiting room templates with customizable UI options
  • Real-time Queue Updates: Receive live queue position, wait time, and progress information
  • Network Recovery: Automatic recovery from network issues to maintain user experience
  • Robust Error Handling: Comprehensive callback system with smart error handling strategies
  • Lightweight SDK: Minimal dependencies with Ktor and Kotlinx Serialization
  • Android Lifecycle Integration: Seamless integration with Activity lifecycle and Android components

System Requirements

  • Android API Level: 22+ (Android 5.1 Lollipop or higher)
  • Java: 1.8 or higher
  • Kotlin: 1.9.0 or higher (for Kotlin-based projects)
  • Dependencies: Ktor 2.1.0+ (< 3.0.0), Kotlinx Serialization

Compatible Environments

  • Native Android Apps: Java/Kotlin-based Android applications with full SDK integration
  • Hybrid Apps: Applications with native Android components (WebView content is not protected by this SDK)
  • All Android Build Types: Debug and release builds with ProGuard/R8 support

How It Works

The Android SDK integrates seamlessly with your app's lifecycle:

  1. SDK Initialization: Initialize NetFUNNEL SDK in your Application class
  2. Native Integration: Call nfStart() for Basic Control or nfStartSection() for Section Control in your Android Activities/Fragments
  3. WebView Waiting Room: SDK displays WebView-based waiting room (default template or custom UI)
  4. Queue Management: NetFUNNEL server handles queue position and admission automatically
  5. Key Return: Call nfStop() for Basic Control or nfStopSection() for Section Control when users complete their actions

Control Flow Examples

Basic Control Flow:

User Action → nfStart() → Waiting Room → onSuccess() → User Proceeds → nfStop()

Section Control Flow:

User Action → nfStartSection() → Waiting Room → onSuccess() → User in Section → nfStopSection()

Important Limitations

Hybrid App Limitations
  • WebView Content: This SDK does not protect WebView content (HTML/JavaScript pages)
  • Native Components Only: Traffic control applies only to native Android components (Activities, Fragments, etc.)
  • Web/JavaScript Agent: For WebView-based content, use the JavaScript Agent instead

Getting Started

To quickly begin with Android Agent, refer to the Quickstart guide.

Practice Projects Available

Need a basic project to practice with? Check out our Sample Projects which include an Android Application (Single Activity) template ready for NetFUNNEL SDK integration practice.

Documentation

Core Documentation

Implementation Guides