-
public class TDConfigsdk config.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumTDConfig.ModeEnumRunning mode. The default mode is NORMAL.
public enumTDConfig.TDModeRunning mode. The default mode is NORMAL.
public enumTDConfig.TDDNSServicepublic final classTDConfig.NetworkType
-
Field Summary
Fields Modifier and Type Field Description public final static StringVERSIONpublic DNSServiceManagermDnsServiceManagerprivate volatile Stringnameprivate TDSecreteKeysecreteKeypublic final StringmTokenpublic final ContextmContextpublic booleanmEnableDNSpublic booleandisableRConfigpublic booleanmEnableAutoPushpublic booleanenableAutoCalibratedpublic final static longDEFAULT_SESSION_TIMEOUT_MILLISpublic List<String>backupUrlList
-
Method Summary
Modifier and Type Method Description StringgetName()voidsetName(String name)TDSecreteKeygetSecreteKey()static TDConfiggetInstance(Context context, String token)static TDConfiggetInstance(Context context, String token, String url)Obtain the TDConfig instance. static TDConfiggetInstance(Context context, String token, String url, String name)Obtain the TDConfig instance. TDConfigsetMutiprocess(boolean isSupportMultiProcess)Specifies whether data reporting by multiple processes is supported. booleanisEnableMutiprocess()Whether to allow multi-process TDConfigsetSessionTimeout(long timeoutMillis)Sets how long, in milliseconds, the SDK keeps the current {@code #session_id}after the last event.longgetSessionTimeout()Returns the session timeout in milliseconds. TDConfigsetMode(TDConfig.ModeEnum mode)Set the SDK running mode. TDConfigsetMode(TDConfig.TDMode mode)Set the SDK running mode. TDConfig.ModeEnumgetMode()Obtain the current running mode of the SDK. synchronized booleanisShouldFlush(String networkType)StringgetServerUrl()StringgetCurrentServerUrl()Get the current server URL being used (primary or backup).The URL list is built dynamically: [serverUrl, backupUrl1, backupUrl2, ... voidswitchToNextUrl()Switch to the next URL in the list (for retry logic). List<String>getAllServerUrlList()Get total number of available URLs (primary + backups). StringgetDebugUrl()booleanisDebugOnly()booleanisNormal()intgetFlushInterval()intgetFlushBulkSize()TDConfigsetTrackOldData(boolean trackOldData)booleantrackOldData()synchronized TDConfigsetDefaultTimeZone(TimeZone timeZone)synchronized TimeZonegetDefaultTimeZone()TDConfigenableEncrypt(boolean enableEncrypt)TDConfigsetSecretKey(TDSecreteKey key)TDConfigenableEncrypt(int version, String publicKey)booleanisEncryptGcmSupported()Whether the receiver is known to support AES-GCM. TDConfigenableDNSService(List<TDConfig.TDDNSService> lists)TDConfigenableAutoPush()synchronized TDConfigsetSSLSocketFactory(SSLSocketFactory sslSocketFactory)synchronized SSLSocketFactorygetSSLSocketFactory()-
-
Method Detail
-
getSecreteKey
TDSecreteKey getSecreteKey()
-
getInstance
static TDConfig getInstance(Context context, String token)
-
getInstance
static TDConfig getInstance(Context context, String token, String url)
Obtain the TDConfig instance. This example can be used to initialize ThinkingAnalyticsSDK. Each SDK instance corresponds to one TDConfig instance.
- Parameters:
context- app contexttoken- APP IDurl- The URL of the data receiving end must be the complete URL with the protocol; otherwise, an exception will be thrown
-
getInstance
static TDConfig getInstance(Context context, String token, String url, String name)
Obtain the TDConfig instance. This example can be used to initialize ThinkingAnalyticsSDK. Each SDK instance corresponds to one TDConfig instance.
- Parameters:
context- app contexttoken- APP IDurl- The URL of the data receiving end must be the complete URL with the protocol; otherwise, an exception will be thrownname- instance name
-
setMutiprocess
TDConfig setMutiprocess(boolean isSupportMultiProcess)
Specifies whether data reporting by multiple processes is supported. By default, data reporting by multiple processes is disabledData reporting by multiple processes has certain performance loss, and cross-process communication is a relatively slow process.
- Parameters:
isSupportMultiProcess- multiple processes is supported
-
isEnableMutiprocess
boolean isEnableMutiprocess()
Whether to allow multi-process
-
setSessionTimeout
TDConfig setSessionTimeout(long timeoutMillis)
Sets how long, in milliseconds, the SDK keeps the current
{@code #session_id}after the last event. The next event starts a new session id when the gapreaches this value. App foreground/background transitions do not reset thegap. A login, account switch, or logout also makes the next event start anew session. Repeated login with the same account keeps the current session.The default is 5 minutes ({@code 300000}).A value less than or equal to 0 falls back to the default.TDConfig config = TDConfig.getInstance(context, APP_ID, SERVER_URL); config.setSessionTimeout(10 * 60 * 1000L);- Parameters:
timeoutMillis- session timeout in milliseconds
-
getSessionTimeout
long getSessionTimeout()
Returns the session timeout in milliseconds.
-
setMode
TDConfig setMode(TDConfig.ModeEnum mode)
Set the SDK running mode.
- Parameters:
mode- running mode
-
setMode
TDConfig setMode(TDConfig.TDMode mode)
Set the SDK running mode.
- Parameters:
mode- running mode
-
getMode
TDConfig.ModeEnum getMode()
Obtain the current running mode of the SDK.
-
isShouldFlush
synchronized boolean isShouldFlush(String networkType)
-
getServerUrl
String getServerUrl()
-
getCurrentServerUrl
String getCurrentServerUrl()
Get the current server URL being used (primary or backup).The URL list is built dynamically: [serverUrl, backupUrl1, backupUrl2, ...]
-
switchToNextUrl
void switchToNextUrl()
Switch to the next URL in the list (for retry logic).
-
getAllServerUrlList
List<String> getAllServerUrlList()
Get total number of available URLs (primary + backups).
-
getDebugUrl
String getDebugUrl()
-
isDebugOnly
boolean isDebugOnly()
-
isNormal
boolean isNormal()
-
getFlushInterval
int getFlushInterval()
-
getFlushBulkSize
int getFlushBulkSize()
-
setTrackOldData
TDConfig setTrackOldData(boolean trackOldData)
-
trackOldData
boolean trackOldData()
-
setDefaultTimeZone
synchronized TDConfig setDefaultTimeZone(TimeZone timeZone)
-
getDefaultTimeZone
synchronized TimeZone getDefaultTimeZone()
-
enableEncrypt
TDConfig enableEncrypt(boolean enableEncrypt)
-
setSecretKey
TDConfig setSecretKey(TDSecreteKey key)
-
enableEncrypt
TDConfig enableEncrypt(int version, String publicKey)
-
isEncryptGcmSupported
boolean isEncryptGcmSupported()
Whether the receiver is known to support AES-GCM. Report data is only encrypted when thisreturns true, so that a new SDK talking to an old receiver falls back to plaintext insteadof uploading data the receiver cannot decrypt.
The flag comes from the remote config field
{@code secret_key.mode}and is persisted, sofrom the second launch on it is available before the config request returns. On the veryfirst launch it stays unknown until the config response arrives.
-
enableDNSService
TDConfig enableDNSService(List<TDConfig.TDDNSService> lists)
-
enableAutoPush
TDConfig enableAutoPush()
-
setSSLSocketFactory
synchronized TDConfig setSSLSocketFactory(SSLSocketFactory sslSocketFactory)
-
getSSLSocketFactory
synchronized SSLSocketFactory getSSLSocketFactory()
-
-
-
-