The application developer must respect and protect the personal information of end users and cannot illegally collect or use it when the application developer provides network services based on the laws, regulations, and regulatory requirements, including Personal Information Protection Law, Data Security Law, and Cybersecurity Law. This guide is intended to help developers implement protections for personal information and prevent any infringement on the personal information rights of end users.
1. HTTPDNS SDK system permissions that you need to apply for
Permission | Required | Purpose |
INTERNET | Yes | The basic permission to allow the SDK to connect to the Internet. The permission is used for domain name resolution in the cloud. |
ACCESS_NETWORK_STATE | Yes | You can view the network status. The permission is used to trigger the IP address of the domain name in the cloud resolution cache when the network type is changed. |
2. HTTPDNS SDK features and related personal information
Feature | Collected personal information field | Purpose of personal information collection | Configuration and example |
Domain name resolution (Basic feature) | N/A | N/A | N/A |
3. Solution to configure HTTPDNS SDK compliance and initialization
// The SDK configuration method. Configure only the HTTPDNS configuration information.
// The configuration method consumes less time and does not affect the user experience of cold start of the app.
public static void init(String accountId, InitConfig config);
// Obtain the HTTPDNS service instance. The first time you obtain an instance, HttpDnsService is initialized.
// Make sure that you agree to the Privacy Policy before you call HttpDns.getService().
public static HttpDnsService getService(Context applicationContext, String accountID)The HttpDns.init() method can be called before you agree to the Privacy Policy.
Make sure that you agree to the Privacy Policy before you call HttpDns.getService().
Sample code
InitConfig config = InitConfig.Builder()
// Specify the initial region.
.setRegion(currentRegion)
// Specify whether to enable HTTPS. By default, HTTP is enabled.
.setEnableHttps(enableHttps)
// Specify the timeout period of a service request. Unit: milliseconds. The default period is 2 seconds. The maximum priod is 5 seconds.
.setTimeout(2 * 1000)
// Specify whether to enable local caching. By default, local caching is disabled.
.setEnableCacheIp(true)
// Specify whether expired IP addresses can be returned. By default, expired IP addresses can be returned.
.setEnableExpiredIp(true)
// Specify a list of IPv4 addresses that you want to probe to obtain the optimal IPv4 address.
.setIPRankingList(ipRankingItemJson.toIPRankingList())
// Specify a custom time-to-live (TTL) for the cache.
.configCacheTtlChanger(ttlChanger)
// Configure the domain name list of fixed IP addresses, which can optimize the internal logic of the SDK and reduce the resolution frequency.
.configHostWithFixedIp(hostListWithFixedIp)
// Configure a domain name resolution policy that executed by using HTTPDNS.
.setNotUseHttpDnsFilter(notUseHttpDnsFilter)
.build()
HttpDns.init(accountID, config);
// Make sure that you agree to the Privacy Policy and complete authorization before you call HttpDns.getService(...).
HttpDns.getService(...)InitConfig config = new InitConfig.Builder()
// Specify the initial region.
.setRegion(currentRegion)
// Specify whether to enable HTTPS. By default, HTTP is enabled.
.setEnableHttps(enableHttps)
// Specify the timeout period of a service request. Unit: milliseconds. The default period is 2 seconds. The maximum priod is 5 seconds.
.setTimeout(2 * 1000)
// Specify whether to enable local caching. By default, local caching is disabled.
.setEnableCacheIp(true)
// Specify whether expired IP addresses can be returned. By default, expired IP addresses can be returned.
.setEnableExpiredIp(true)
// Specify a list of IPv4 addresses that you want to probe to obtain the optimal IPv4 address.
.setIPRankingList(list)
// Specify a TTL for the cache.
.configCacheTtlChanger(ttlChanger)
// Configure the domain name list of fixed IP addresses, which can optimize the internal logic of the SDK and reduce the resolution frequency.
.configHostWithFixedIp(hostListWithFixedIp)
// Configure a domain name resolution policy that executed by using HTTPDNS.
.setNotUseHttpDnsFilter(notUseHttpDnsFilter)
.build();
HttpDns.init(accountID, config);
// Make sure that you agree to the Privacy Policy and complete authorization before you call HttpDns.getService(...).
HttpDns.getService(...);