Back to Vassonic

SonicDownloadEngine (sdk 3.0.0 API)

sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadEngine.html

3.1.15.8 KB
Original Source

跳过导航链接

com.tencent.sonic.sdk.download

类 SonicDownloadEngine

  • java.lang.Object

    • com.tencent.sonic.sdk.download.SonicDownloadEngine
  • 所有已实现的接口:android.os.Handler.Callback


public classSonicDownloadEngineextends java.lang.Object
implements android.os.Handler.Callback

an download initiator

字段概要

字段 | 限定符和类型 | 字段和说明 | | --- | --- | | static java.lang.String | TAG log filter |

构造器概要

构造器 | 构造器和说明 | | --- | | SonicDownloadEngine(SonicDownloadCache cache) |

方法概要

所有方法 实例方法 具体方法 | 限定符和类型 | 方法和说明 | | --- | --- | | void | addSubResourcePreloadTask(java.util.List<java.lang.String> preloadLinks) preload the sub resource in the "sonic-link" header. | | SonicDownloadClient.DownloadTask | download(java.lang.String resourceUrl, java.lang.String ipAddress, java.lang.String cookie, SonicDownloadCallback callback) start downloading one resource. | | boolean | handleMessage(android.os.Message msg) | | java.lang.Object | onRequestSubResource(java.lang.String url, SonicSession session) When the webview initiates a sub resource interception, the client invokes this method to retrieve the data |

- 

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

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

字段详细资料

- 

TAG

public static final java.lang.String TAG

log filter 另请参阅:常量字段值

构造器详细资料

- 

SonicDownloadEngine

public SonicDownloadEngine([SonicDownloadCache](../../../../../com/tencent/sonic/sdk/download/SonicDownloadCache.html "com.tencent.sonic.sdk.download中的类")cache)

参数:cache - A specific implementation of SonicDownloadCache

方法详细资料

- 

handleMessage

public boolean handleMessage(android.os.Message msg)

指定者:handleMessage 在接口中 android.os.Handler.Callback

- 

download

public[SonicDownloadClient.DownloadTask](../../../../../com/tencent/sonic/sdk/download/SonicDownloadClient.DownloadTask.html "com.tencent.sonic.sdk.download中的类")download(java.lang.String resourceUrl,
                                                 java.lang.String ipAddress,
                                                 java.lang.String cookie,[SonicDownloadCallback](../../../../../com/tencent/sonic/sdk/download/SonicDownloadCallback.html "com.tencent.sonic.sdk.download中的接口")callback)

start downloading one resource. if the responding cache exists and isn't expire, will use the cache directly and won't launch a http request; if the number of downloading tasks is bigger than config, the task will be delayed before downloading pool is free. 参数:resourceUrl - the resource's urlipAddress - if dns prefetch the ip address, will use the ip instead of hostcookie - set the cookie for the download http requestcallback - a callback used for notify the download progress and result返回:the download task info

- 

onRequestSubResource

public java.lang.Object onRequestSubResource(java.lang.String url,[SonicSession](../../../../../com/tencent/sonic/sdk/SonicSession.html "com.tencent.sonic.sdk中的类")session)

When the webview initiates a sub resource interception, the client invokes this method to retrieve the data 参数:url - The url of sub resourcesession - current sonic session返回:Return the data to kernel

- 

addSubResourcePreloadTask

public void addSubResourcePreloadTask(java.util.List<java.lang.String> preloadLinks)

preload the sub resource in the "sonic-link" header. 参数:preloadLinks - The links which need to be preloaded.

跳过导航链接