Edge Acceleration
  • Site Acceleration
    • Overview
    • Quickly Import and Export Site Configuration
    • Access Control
      • Token Authentication
    • Smart Acceleration
    • File Optimization
      • Smart Compression
    • Network Optimization
      • HTTP/2
      • HTTP/3(QUIC)
        • Overview
        • Enable HTTP/3
        • QUIC SDK
          • SDK Overview
          • SDK Download and Integration
          • Sample Code
            • Android
            • iOS
          • API Documentation
            • Android
            • iOS
      • IPv6 Access
      • Maximum Upload Size
      • WebSocket
      • Client IP Geolocation Header
      • Client IP Geographical Location
      • gRPC
    • URL Rewrite
      • Access URL Redirection
      • Origin-Pull URL Rewrite
    • Modifying Header
      • Modifying HTTP Response Headers
      • Modifying HTTP Request Headers
    • Custom Error Page
    • Request and Response Actions
      • Processing order
      • Default HTTP Headers of Origin-Pull Requests
      • Default HTTP Response Headers
    • Media Services
      • Audio and Video Pre-pulling
      • Just-in-Time Image Processing
      • Just-in-Time Media Processing
      • VOD Media Origin
  • L4 Proxy
    • Overview
    • Creating an L4 Proxy Instance
    • Modifying an L4 Proxy Instance
    • Disabling or Deleting an L4 Proxy Instance
    • Batch Configuring Forwarding Rules
    • Obtaining Real Client IPs
      • Obtaining Real TCP Client IPs via TOA
      • Obtaining Real Client IPs Through Protocol V1/V2
        • Overview
        • Method 1: Obtaining Real Client IPs Through Nginx
        • Method 2: Parsing Real Client IPs on Application Server
        • Format of Real Client IPs Obtained Through Proxy Protocol V1/V2
      • Transmitting Client Real IP via SPP Protocol
  • Edge DNS
    • Hosting DNS Records
      • Modifying DNS Servers
      • Configuring DNS Records
      • Advanced DNS Configuration
    • Domain Connection
      • Adding A Domain Name for Acceleration
      • Ownership Verification
      • Modifying CNAME Records
    • Domain alias
      • Overview
      • Configuration Guide
      • Batch Connecting SaaS Domain Names
      • Configuring Alias Domain Names for Disaster Recovery
    • Traffic Scheduling
      • Traffic Scheduling Management
    • Origin Configuration
      • Origin-pull configuration
        • Configuring Origin-Pull HTTPS
        • Host Header Rewrite
        • Controlling Origin-pull Requests
        • Redirect Following During Origin-Pull
        • HTTP/2 Origin-Pull
        • Range GETs
      • Load Balancing
        • Overview
        • Quickly Create Load Balancers
        • Health Check Policies
        • Viewing the Health Status of Origin Server
        • Related References
          • Load Balancing-Related Concepts
          • Introduction to Request Retry Strategy
      • Origin Group Configuration
      • Related References
        • ld Version Origin Group Compatible Related Issues
      • Collect EdgeOne origin-pull node IP
  • Edge Cache
    • Overview
    • EdgeOne Cache Rules
      • Content Cache Rules
      • Cache Key Introduction
      • Vary Feature
    • Cache Configuration
      • Custom Cache Key
      • Node Cache TTL
      • Status Code Cache TTL
      • Browser Cache TTL
      • Offline Caching
      • Cache Prefresh
    • Clear and Preheat Cach
      • Cache Purge
      • URL Pre-Warming
    • How to improve the Cache Hit Rate of EdgeOne
  • Rules Engine
    • Overview
    • Supported Matching Types and Actions
    • Rule Management
    • variables

Android

API Overview

API
Description
The main function of QUIC, used to create QuicCall instances and QUIC configuration and get the version number etc.
QuicCall
Manage QUIC requests.
Encapsulate requests.
Encapsulate responses.
Execute callbacks.
Get information about QUIC network status.

QuicClient

The main function of QUIC, used to create QuicCall instances and QUIC configuration and get the version number etc.
API
Description
newCall
Create a QuicCall instance.
Builder
Construct QUIC configuration .
Get the SDK version number.

newCall

Create a QuicCall instance for each QUIC request.
QuicCall newCall(QuicRequest request)
Parameter
Description
request
The request to be encapsulated. See QuicRequest.

getVersion

A static method that can get the SDK version number.
String getVersion()

Builder

QUIC configuration APIs
API
Description
Set the QUIC version.
Set the congestion control algorithm.
Set the connection timeout.
Set the total timeout for the request.
Set the idle connection timeout.
Whether to support IPv6.
build
Create QuicClient.

setQuicVersion

Set the QUIC version.
Builder setQuicVersion(int quicVersion)
Parameter
Description
quicVersion
Set the QUIC version. Supported versions: Q043, Q046, Q050, Q051, draft-29, RFC-V1 (RFC 9000).
Values:
QuicClient.QUIC_VERSION_Q43 (default)
QuicClient.QUIC_VERSION_Q46 audio/video proxy
QuicClient.QUIC_VERSION_Q50 audio/video proxy
QuicClient.QUIC_VERSION_Q51 audio/video proxy
QuicClient.QUIC_VERSION_IETF_DRAFT_29 audio/video proxy
QuicClient.QUIC_VERSION_IETF_RFC_V1 audio/video proxy

setCongestionType

Set the congestion control algorithm.
Builder setCongestionType(int congestionType)
Parameter
Description
congestionType
Supported congestion control algorithms: CubicBytes, RenoBytes, BBR, PCC, GCC.
Values:
QuicClient.CONGESTION_TYPE_BBR (default)
QuicClient.CONGESTION_TYPE_RENO_BYTES
QuicClient.CONGESTION_TYPE_BBR
QuicClient.CONGESTION_TYPE_PCC
QuicClient.CONGESTION_TYPE_GCC

setConnectTimeoutMillis

Set the connection timeout.
Builder setConnectTimeoutMillis(int connectTimeoutMillis)
Parameter
Description
connectTimeoutMillis
Set the connection timeout in milliseconds.
Default value: 60000.

setTotalTimeoutMillis

Set the total timeout that covers data read and write.
Builder setTotalTimeoutMillis(int totalTimeoutMillis)
Parameter
Description
totalTimeoutMillis
Set the total timeout in milliseconds.
Default value: 0 (no timeout).

setIdleTimeoutMillis

Set the idle connection timeout. When the timeout expires, connections are closed and cannot be reused.
Builder setIdleTimeoutMillis(int idleTimeoutMillis)
Parameter
Description
idleTimeoutMillis
The idle connection timeout in milliseconds.
Default value: 90000.

setSupportIpV6

Whether to support IPv6.
Builder setSupportIpV6(boolean supportIpV6)
Parameter
Description
supportIpV6 audio/video proxy
Whether to support IPv6. Values: true, false.
Default value: false.

build

Create QuicClient.
QuicClient build()

QuicCall

Manage QUIC requests.
API
Description
enqueue
Initiate an asynchronous QUIC network request.
cancel
Cancel requests.
Get information about QUIC network status. For more details, see QuicNetStats.

enqueue

Add an asynchronous QUIC request to the queue. You can get response from the callback function.
void enqueue(QuicCallback callback)
Parameter
Description
callback
Return response from the callback function. For more details, see QuicCallback.

cancel

Cancel requests.
void cancel()

getQuicNetStats

Get information about QUIC network status.
QuicNetStats getQuicNetStats()

QuicRequest

Request parameter
API
Description
Builder
Construct a request parameter.

Builder

API
Description
setUrl
Set the request URL.
setIp
Set the request IP.
addHeader
Add the request header
get
Set the request type to GET.
post
Set the request type to POST.
method
Set other request parameters.
build
Create a QuicRequest object.

setUrl

Set the request URL.
Builder setUrl(String url)
Parameter
Description
url
(Required) The request URL.

setIp

Set the request IP address.
Builder setIp(String ip)
Parameter
Description
ip
(Optional) If you do not use DNS resolution, set the IP address that the hostname resolves to.

addHeader

Add the request header in a key-value format.
Builder addHeader(String key, String value)
Parameter
Description
key
Key of the header.
value
Value of the header.

get

Set the request type to GET.
Builder get()

post

Set the request type to POST.
Builder post(RequestBody body)
Parameter
Description
body
Body data.

method

Construct DELETE, PUT and other requests.
Builder method(String method, RequestBody body)
Parameter
Description
method
Supported request methods: PUT, DELETE, HEAD, PATCH.
body
Body data.

build

Create QuicRequest
QuicRequest build()

QuicResponse

Response information
API
Description
getCode
Get the response status code.
Get the response headers.
Get Content-Type.
Get Content-Length.
body
Get the response body.

getCode

Get the response status code.
int getCode()

getHeaders

Get a list of response headers.
List<String> getHeaders()

getContentType

Get the content type from the response.
void setContentType(String contentType)
Parameter
Description
contentType
Get the content type.

getContentLength

Get the content length.
void setContentLength(long contentLength)
Parameter
Description
contentLength
Get the content length.

body

Get the body of the response.
ResponseBody body()

QuicCallback

Execute callbacks.
API
Description
The callback succeeded.
onFailed
The callback failed.

onResponse

The callback function to execute when the request has succeeded.
void onResponse(QuicCall call, QuicResponse response) throws IOException
Parameter
Description
call
Manage the QUIC request. For more details, see QuicCall.
response
Return the QUIC response. For more details, see QuicResponse.

onFailed

The callback function to execute when the request has failed.
void onFailed(QuicCall call, int errorCode, String errorMsg)
Parameter
Description
call
Manage the QUIC request. For more details, see QuicCall.
errorCode
The error code.
errorMsg
The error message.

QuicNetStats

Get information about QUIC network status.
API
Description
isValid
Whether the value of status is valid.
isQuic
Whether it is a QUIC request.
is0rtt
Whether it is a 0-RTT connection.
isConnReuse
Whether the connection is reused.
getConnectMs
Get the connection duration in milliseconds.
getDnsMs
Get the DNS duration in milliseconds.
getDnsCode
Get the DNS error code.
getTtfbMs
Get the time taken for the first byte to be received in milliseconds.
getCompleteMs
Get the time taken for the request to be completed in milliseconds. The time taken by the connection is not included.
getSrttMs
Get the average round-trip time in milliseconds.
getPacketsSent
Get the number of packets sent in bytes.
getPacketsRetransmitted
Get the number of packets retransmitted in bytes.
getBytesSent
Get the number of bytes sent.
getBytesRetransmitted
Get the number of bytes retransmitted.
getPacketsLost
Get the number of packets lost in bytes.
getPacketsReceived
Get the number of packets received in bytes.
getBytesReceived
Get the number of bytes received.
getStreamBytesReceived
Get the number of bytes received within the stream.