Back to Vassonic

StandardSonicSession (sdk 3.0.0 API)

sonic-android/docs/javadoc/com/tencent/sonic/sdk/StandardSonicSession.html

3.1.111.5 KB
Original Source

跳过导航链接

com.tencent.sonic.sdk

类 StandardSonicSession


public classStandardSonicSessionextends[SonicSession](../../../../com/tencent/sonic/sdk/SonicSession.html "com.tencent.sonic.sdk中的类")implements android.os.Handler.Callback

A subclass of SonicSession. StandardSonicSession only uses the way of SonicSessionClient.loadUrl(String, Bundle) (not loadData). When client initiates a resource interception, the user can set response and header information (such as csp) for the kernel.

See also QuickSonicSession

嵌套类概要

- 

从类继承的嵌套类/接口 com.tencent.sonic.sdk.SonicSession

SonicSession.Callback

字段概要

- 

从类继承的字段 com.tencent.sonic.sdk.SonicSession

CHROME_FILE_THREAD, CLIENT_MSG_NOTIFY_RESULT, CLIENT_MSG_ON_WEB_READY, clientIsReady, clientIsReload, COMMON_MSG_BEGIN, COMMON_MSG_END, config, createdTime, DATA_UPDATE_BUNDLE_PARAMS_DIFF, diffDataCallback, FILE_THREAD_MSG_BEGIN, FILE_THREAD_SAVE_CACHE_ON_SERVER_CLOSE, FILE_THREAD_SAVE_CACHE_ON_SESSION_FINISHED, fileHandler, finalResultCode, id, intent, isPreload, isWaitingForDestroy, isWaitingForSaveFile, isWaitingForSessionThread, mainHandler, OFFLINE_MODE_FALSE, OFFLINE_MODE_HTTP, OFFLINE_MODE_STORE, OFFLINE_MODE_TRUE, pendingDiffData, pendingWebResourceStream, preloadLinks, RESOURCE_INTERCEPT_STATE_IN_FILE_THREAD, RESOURCE_INTERCEPT_STATE_IN_OTHER_THREAD, RESOURCE_INTERCEPT_STATE_NONE, resourceDownloaderEngine, resourceInterceptState, server, SESSION_MSG_FORCE_DESTROY, sessionCallbackList, sessionClient, sessionState, sId, sNextSessionLogId, SONIC_RESULT_CODE_DATA_UPDATE, SONIC_RESULT_CODE_FIRST_LOAD, SONIC_RESULT_CODE_HIT_CACHE, SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_UNKNOWN, srcResultCode, srcUrl, STATE_DESTROY, STATE_NONE, STATE_READY, STATE_RUNNING, stateChangedCallbackList, statistics, wasInterceptInvoked, wasOnPageFinishInvoked, WEB_RESPONSE_CODE, WEB_RESPONSE_DATA, WEB_RESPONSE_EXTRA, WEB_RESPONSE_LOCAL_REFRESH_TIME, WEB_RESPONSE_SRC_CODE

方法概要

所有方法 实例方法 具体方法 | 限定符和类型 | 方法和说明 | | --- | --- | | int | getSrcResultCode() | | protected void | handleFlow_DataUpdate(java.lang.String serverRsp) Sonic obtains the difference data between the server and the local data first,then sonic will build the template and server data into html.If client did not load url before, the new html will be encapsulated as an inputStreamByteArrayInputStream,When client initiates a resource interception, sonic provides the inputStream to the kernel. | | protected void | handleFlow_FirstLoad() Sonic will always read the new data from the server until client initiates a resource interception If the server data is not read finished sonic will split the read and unread data into a bridgedStreamSonicSessionStream, otherwise all the read data will be encapsulated as an inputStreamByteArrayInputStream. | | protected void | handleFlow_HttpError(int responseCode) | | protected void | handleFlow_LoadLocalCache(java.lang.String localHtml) | | protected void | handleFlow_ServiceUnavailable() | | protected void | handleFlow_TemplateChange(java.lang.String newHtml) Sonic will always read the new data from the server until the local page finish. | | boolean | handleMessage(android.os.Message msg) Subclasses must implement this to receive messages. | | boolean | onClientReady() Client informs sonic that it is ready. | | protected java.lang.Object | onRequestResource(java.lang.String url) When the webview initiates a main resource interception, the client invokes this method to retrieve the data | | boolean | onWebReady(SonicDiffDataCallback callback) Client will call this method to obtain the update data when the page shows the content. |

- 

从类继承的方法 com.tencent.sonic.sdk.SonicSession

addSessionCallback, addSessionStateChangedCallback, bindClient, canDestroy, clearSessionData, createConnectionIntent, destroy, destroy, doSaveSonicCache, getCacheHeaders, getCharsetFromHeaders, getCharsetFromHeaders, getCurrentUrl, getFinalResultCode, getHeaders, getSessionClient, getStatistics, handleFlow_Connection, handleFlow_NotModified, isDestroyedOrWaitingForDestroy, isMatchCurrentUrl, isPreload, notifyStateChange, onClientPageFinished, onClientRequestResource, onServerClosed, postForceDestroyIfNeed, postTaskToSaveSonicCache, refresh, removeSessionCallback, removeSessionStateChangedCallback, setCookiesFromHeaders, setResult, shouldSetCookieAsynchronous, start, switchState

- 

从类继承的方法 java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

方法详细资料

- 

getSrcResultCode

public int getSrcResultCode()

覆盖:getSrcResultCode 在类中 SonicSession

- 

handleMessage

public boolean handleMessage(android.os.Message msg)

从类复制的说明: SonicSession

Subclasses must implement this to receive messages. 指定者:handleMessage 在接口中 android.os.Handler.Callback覆盖:handleMessage 在类中 SonicSession

- 

onClientReady

public boolean onClientReady()

从类复制的说明: SonicSession

Client informs sonic that it is ready. Client ready means it's webview has been initialized, can start load url or load data. 覆盖:onClientReady 在类中 SonicSession返回:True if it is set for the first time

- 

onWebReady

public boolean onWebReady([SonicDiffDataCallback](../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html "com.tencent.sonic.sdk中的接口")callback)

从类复制的说明: SonicSession

Client will call this method to obtain the update data when the page shows the content. 覆盖:onWebReady 在类中 SonicSession参数:callback - Sonic provides the latest data to the page through this callback返回:The result

- 

onRequestResource

protected java.lang.Object onRequestResource(java.lang.String url)

从类复制的说明: SonicSession

When the webview initiates a main resource interception, the client invokes this method to retrieve the data 覆盖:onRequestResource 在类中 SonicSession参数:url - The url of this session返回:Return the data to kernel

- 

handleFlow_LoadLocalCache

protected void handleFlow_LoadLocalCache(java.lang.String localHtml)

指定者:handleFlow_LoadLocalCache 在类中 SonicSession

- 

handleFlow_TemplateChange

protected void handleFlow_TemplateChange(java.lang.String newHtml)

Sonic will always read the new data from the server until the local page finish. If the server data is not read finished sonic will split the read and unread data into a bridgedStreamSonicSessionStream, otherwise all the read data will be encapsulated as an inputStreamByteArrayInputStream. When client initiates a resource interception, sonic will provide the bridgedStream or inputStream to the kernel.

If need save and separate data, sonic will save the server data and separate the server data to template and data.

指定者:handleFlow_TemplateChange 在类中 SonicSession参数:newHtml - new Html string from web-server

- 

handleFlow_HttpError

protected void handleFlow_HttpError(int responseCode)

指定者:handleFlow_HttpError 在类中 SonicSession

- 

handleFlow_ServiceUnavailable

protected void handleFlow_ServiceUnavailable()

指定者:handleFlow_ServiceUnavailable 在类中 SonicSession

- 

handleFlow_FirstLoad

protected void handleFlow_FirstLoad()

Sonic will always read the new data from the server until client initiates a resource interception If the server data is not read finished sonic will split the read and unread data into a bridgedStreamSonicSessionStream, otherwise all the read data will be encapsulated as an inputStreamByteArrayInputStream. When client initiates a resource interception, sonic will provide the bridgedStream or inputStream to the kernel.

If need save and separate data, sonic will save the server data and separate the server data to template and data

指定者:handleFlow_FirstLoad 在类中 SonicSession

- 

handleFlow_DataUpdate

protected void handleFlow_DataUpdate(java.lang.String serverRsp)

Sonic obtains the difference data between the server and the local data first,then sonic will build the template and server data into html.If client did not load url before, the new html will be encapsulated as an inputStreamByteArrayInputStream,When client initiates a resource interception, sonic provides the inputStream to the kernel. If client did load url before, sonic provides the diff data to page when page obtains the diff data. 指定者:handleFlow_DataUpdate 在类中 SonicSession参数:serverRsp - Server response data.

跳过导航链接