Android SDK compliance instructions

更新时间:
复制 MD 格式
Note

According to the Personal Information Protection Law, Data Security Law, Network Security Law, and other regulatory requirements, application developers must respect and protect end users' personal information and must not collect or use such information unlawfully while providing network services. These compliance instructions help developers meet personal information protection requirements when using the HTTPDNS SDK and avoid infringing upon end users' personal information rights.

I. Android SDK system permission requirements

Permission

Required

Purpose

INTERNET

Yes

Allows the SDK to connect to the Internet for cloud-based domain name resolution. This is a basic network permission.

ACCESS_NETWORK_STATE

Yes

Used to check network status and trigger IP resolution for domain names in the preload method when a network change occurs.

II. Android SDK features and related personal information

Feature

Collected personal information field

Purpose

Configuration

Domain name resolution

(Basic feature)

N/A

N/A

N/A

III. Android SDK compliance initialization configuration

public static void Init(Context ctx, String accountID, String accessKeyId, String accessKeySecret)
Important

You must ensure that users have agreed to the Privacy Policy before calling the DNSResolver.Init() method.

Sample code

public class DnsCacheApplication extends Application{

    private String Account ID = "your Account ID"; //Set the Account ID you used to access the SDK in the console
    private String AccessKey ID = "your AccessKey ID"; //Set the AccessKey ID you used to access the SDK in the console
    private String AccessKey Secret = "your AccessKey Secret"; //Set the AccessKey Secret you used to access the SDK in the console

    @Override
    public void onCreate() {
       super.onCreate();
       DNSResolver.Init(this,Account ID,AccessKey ID,AccessKey Secret); //Set the Account ID, AccessKey ID, and AccessKey Secret used to access the SDK in the console
       //Note: Setting domains for cache retention will automatically initiate resolution at TTL * 75% to ensure that configured domain resolution always hits the cache. However, if users use CDN, this can result in very small TTL values, generating many resolution requests and increasing costs. Please use this method with caution.
       DNSResolver.setKeepAliveDomains(new String[]{"your cache retention domain 1","your cache retention domain 2",...});       
       DNSResolver.getInstance().preLoadDomains(DNSResolver.QTYPE_IPV4,new String[]{"your preload domain 1","your preload domain 2",...}); //Set specified IPV4 type domain pre-resolution, replace preload domains with the domains you want to resolve using Alibaba DNS
    }
}