Showing preview only (2,256K chars total). Download the full file or copy to clipboard to get everything.
Repository: Tencent/VasSonic
Branch: master
Commit: 59936beff656
Files: 288
Total size: 2.1 MB
Directory structure:
gitextract_nx2cxqfl/
├── .gitignore
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
├── LICENSE
├── README.md
├── assets/
│ ├── Sonic2.0.md
│ ├── VasSonic3.0_preload.md
│ └── sonic发展历程.md
├── checkstyle.xml
├── sonic-android/
│ ├── .gitignore
│ ├── README.md
│ ├── build.gradle
│ ├── docs/
│ │ ├── Sonic Quick模式实现原理.md
│ │ ├── Sonic Standard模式实现原理.md
│ │ ├── Sonic接入指引.md
│ │ ├── Sonic框架介绍.md
│ │ ├── javadoc/
│ │ │ ├── allclasses-frame.html
│ │ │ ├── allclasses-noframe.html
│ │ │ ├── com/
│ │ │ │ └── tencent/
│ │ │ │ └── sonic/
│ │ │ │ └── sdk/
│ │ │ │ ├── QuickSonicSession.html
│ │ │ │ ├── SonicCacheInterceptor.html
│ │ │ │ ├── SonicConfig.Builder.html
│ │ │ │ ├── SonicConfig.html
│ │ │ │ ├── SonicConstants.html
│ │ │ │ ├── SonicDBHelper.html
│ │ │ │ ├── SonicDiffDataCallback.html
│ │ │ │ ├── SonicEngine.html
│ │ │ │ ├── SonicFileUtils.html
│ │ │ │ ├── SonicResourceDataHelper.ResourceData.html
│ │ │ │ ├── SonicResourceDataHelper.html
│ │ │ │ ├── SonicRuntime.html
│ │ │ │ ├── SonicServer.html
│ │ │ │ ├── SonicSession.Callback.html
│ │ │ │ ├── SonicSession.html
│ │ │ │ ├── SonicSessionClient.html
│ │ │ │ ├── SonicSessionConfig.Builder.html
│ │ │ │ ├── SonicSessionConfig.html
│ │ │ │ ├── SonicSessionConnection.SessionConnectionDefaultImpl.html
│ │ │ │ ├── SonicSessionConnection.html
│ │ │ │ ├── SonicSessionConnectionInterceptor.html
│ │ │ │ ├── SonicSessionStatistics.html
│ │ │ │ ├── SonicSessionStream.Callback.html
│ │ │ │ ├── SonicSessionStream.html
│ │ │ │ ├── SonicUtils.html
│ │ │ │ ├── StandardSonicSession.html
│ │ │ │ ├── download/
│ │ │ │ │ ├── SonicDownloadCache.SonicResourceCache.html
│ │ │ │ │ ├── SonicDownloadCache.html
│ │ │ │ │ ├── SonicDownloadCallback.SimpleDownloadCallback.html
│ │ │ │ │ ├── SonicDownloadCallback.html
│ │ │ │ │ ├── SonicDownloadClient.DownloadTask.html
│ │ │ │ │ ├── SonicDownloadClient.SonicDownloadConnection.html
│ │ │ │ │ ├── SonicDownloadClient.SubResourceDownloadCallback.html
│ │ │ │ │ ├── SonicDownloadClient.html
│ │ │ │ │ ├── SonicDownloadEngine.html
│ │ │ │ │ ├── package-frame.html
│ │ │ │ │ ├── package-summary.html
│ │ │ │ │ └── package-tree.html
│ │ │ │ ├── package-frame.html
│ │ │ │ ├── package-summary.html
│ │ │ │ └── package-tree.html
│ │ │ ├── constant-values.html
│ │ │ ├── deprecated-list.html
│ │ │ ├── help-doc.html
│ │ │ ├── index-all.html
│ │ │ ├── index.html
│ │ │ ├── overview-frame.html
│ │ │ ├── overview-summary.html
│ │ │ ├── overview-tree.html
│ │ │ ├── package-list
│ │ │ ├── script.js
│ │ │ └── stylesheet.css
│ │ └── sdk-3.0.0-javadoc.jar
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── sample/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── assets/
│ │ │ └── sonic-demo-index.html
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── tencent/
│ │ │ └── sonic/
│ │ │ └── demo/
│ │ │ ├── BrowserActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── SonicJavaScriptInterface.java
│ │ │ ├── SonicRuntimeImpl.java
│ │ │ ├── SonicSessionClientImpl.java
│ │ │ ├── UrlListAdapter.java
│ │ │ └── UrlSelector.java
│ │ └── res/
│ │ ├── drawable/
│ │ │ ├── ic_add_circle_accent_24dp.xml
│ │ │ ├── ic_add_circle_black_24dp.xml
│ │ │ ├── ic_add_circle_selector.xml
│ │ │ ├── ic_remove_circle_accent_24dp.xml
│ │ │ └── sonic_button_round_mask.xml
│ │ ├── layout/
│ │ │ ├── activity_browser.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── dialog_url.xml
│ │ │ └── list_item_url.xml
│ │ └── values/
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── sdk/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ ├── androidTest/
│ │ │ └── java/
│ │ │ └── com/
│ │ │ └── tencent/
│ │ │ └── sonic/
│ │ │ └── sdk/
│ │ │ ├── BaseSonicTest.java
│ │ │ ├── ExampleInstrumentedTest.java
│ │ │ ├── QuickSonicSessionTest.java
│ │ │ ├── SonicRuntimeImplTest.java
│ │ │ ├── SonicSessionClientImplTest.java
│ │ │ └── SonicTestData.java
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── tencent/
│ │ │ └── sonic/
│ │ │ └── sdk/
│ │ │ ├── QuickSonicSession.java
│ │ │ ├── SonicCacheInterceptor.java
│ │ │ ├── SonicConfig.java
│ │ │ ├── SonicConstants.java
│ │ │ ├── SonicDBHelper.java
│ │ │ ├── SonicDataHelper.java
│ │ │ ├── SonicDiffDataCallback.java
│ │ │ ├── SonicEngine.java
│ │ │ ├── SonicFileUtils.java
│ │ │ ├── SonicResourceDataHelper.java
│ │ │ ├── SonicRuntime.java
│ │ │ ├── SonicServer.java
│ │ │ ├── SonicSession.java
│ │ │ ├── SonicSessionCallback.java
│ │ │ ├── SonicSessionClient.java
│ │ │ ├── SonicSessionConfig.java
│ │ │ ├── SonicSessionConnection.java
│ │ │ ├── SonicSessionConnectionInterceptor.java
│ │ │ ├── SonicSessionStatistics.java
│ │ │ ├── SonicSessionStream.java
│ │ │ ├── SonicSessionThreadPool.java
│ │ │ ├── SonicSniSSLSocketFactory.java
│ │ │ ├── SonicUtils.java
│ │ │ ├── StandardSonicSession.java
│ │ │ └── download/
│ │ │ ├── SonicDownloadCache.java
│ │ │ ├── SonicDownloadCallback.java
│ │ │ ├── SonicDownloadClient.java
│ │ │ └── SonicDownloadEngine.java
│ │ └── res/
│ │ └── values/
│ │ └── strings.xml
│ └── settings.gradle
├── sonic-iOS/
│ ├── .gitignore
│ ├── README.md
│ ├── Sonic/
│ │ ├── Cache/
│ │ │ ├── SonicCache.h
│ │ │ ├── SonicCache.m
│ │ │ ├── SonicCacheItem.h
│ │ │ ├── SonicCacheItem.m
│ │ │ ├── SonicDatabase.h
│ │ │ └── SonicDatabase.m
│ │ ├── Engine/
│ │ │ ├── SonicConfiguration.h
│ │ │ ├── SonicConfiguration.m
│ │ │ ├── SonicEngine.h
│ │ │ └── SonicEngine.m
│ │ ├── Info.plist
│ │ ├── Network/
│ │ │ ├── SonicConnection.h
│ │ │ ├── SonicConnection.m
│ │ │ ├── SonicServer.h
│ │ │ ├── SonicServer.m
│ │ │ ├── SonicURLProtocol.h
│ │ │ └── SonicURLProtocol.m
│ │ ├── ResourceLoader/
│ │ │ ├── SonicResourceLoadOperation.h
│ │ │ ├── SonicResourceLoadOperation.m
│ │ │ ├── SonicResourceLoader.h
│ │ │ └── SonicResourceLoader.m
│ │ ├── Session/
│ │ │ ├── SonicSession.h
│ │ │ ├── SonicSession.m
│ │ │ ├── SonicSessionConfiguration.h
│ │ │ └── SonicSessionConfiguration.m
│ │ ├── Sonic.h
│ │ ├── SonicConstants.h
│ │ ├── SonicProtocol.h
│ │ ├── Statistics/
│ │ │ ├── SonicEventConstants.h
│ │ │ ├── SonicEventStatistics.h
│ │ │ └── SonicEventStatistics.m
│ │ └── Util/
│ │ ├── SonicUtil.h
│ │ └── SonicUtil.m
│ ├── Sonic.xcodeproj/
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace/
│ │ └── contents.xcworkspacedata
│ ├── Sonic.xcworkspace/
│ │ └── contents.xcworkspacedata
│ ├── SonicSample/
│ │ ├── SonicSample/
│ │ │ ├── 36f620dddab622727b270e6b79b20a98/
│ │ │ │ └── main.html
│ │ │ ├── AppDelegate.h
│ │ │ ├── AppDelegate.m
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Contents.json
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ ├── RootViewController.h
│ │ │ ├── RootViewController.m
│ │ │ ├── SonicEventObserver.h
│ │ │ ├── SonicEventObserver.m
│ │ │ ├── SonicJSContext.h
│ │ │ ├── SonicJSContext.m
│ │ │ ├── SonicOfflineCacheConnection.h
│ │ │ ├── SonicOfflineCacheConnection.m
│ │ │ ├── SonicWebViewController.h
│ │ │ ├── SonicWebViewController.m
│ │ │ └── main.m
│ │ ├── SonicSample.xcodeproj/
│ │ │ ├── project.pbxproj
│ │ │ └── project.xcworkspace/
│ │ │ └── contents.xcworkspacedata
│ │ └── SonicSampleUITests/
│ │ ├── Info.plist
│ │ └── SonicSampleUITests.m
│ └── docs/
│ ├── iOS终端实现原理.md
│ └── 终端接入指引-iOS版本.md
├── sonic-java/
│ ├── README.md
│ ├── apidocs/
│ │ ├── allclasses-frame.html
│ │ ├── allclasses-noframe.html
│ │ ├── com/
│ │ │ └── github/
│ │ │ └── tencent/
│ │ │ ├── AbstractReplaceCallBack.html
│ │ │ ├── HttpServletResponseCopier.html
│ │ │ ├── ReplaceCallBack.html
│ │ │ ├── ServletOutputStreamCopier.html
│ │ │ ├── SonicFilter.html
│ │ │ ├── SonicUtil.html
│ │ │ ├── class-use/
│ │ │ │ ├── AbstractReplaceCallBack.html
│ │ │ │ ├── HttpServletResponseCopier.html
│ │ │ │ ├── ReplaceCallBack.html
│ │ │ │ ├── ServletOutputStreamCopier.html
│ │ │ │ ├── SonicFilter.html
│ │ │ │ └── SonicUtil.html
│ │ │ ├── package-frame.html
│ │ │ ├── package-summary.html
│ │ │ ├── package-tree.html
│ │ │ └── package-use.html
│ │ ├── constant-values.html
│ │ ├── deprecated-list.html
│ │ ├── help-doc.html
│ │ ├── index-all.html
│ │ ├── index.html
│ │ ├── overview-tree.html
│ │ ├── package-list
│ │ ├── script.js
│ │ └── stylesheet.css
│ ├── lib/
│ │ ├── VasSonic-1.1-javadoc.jar
│ │ ├── VasSonic-1.1-sources.jar
│ │ └── VasSonic-1.1.jar
│ ├── sample/
│ │ └── webapp/
│ │ ├── WEB-INF/
│ │ │ ├── lib/
│ │ │ │ └── VasSonic-1.1.jar
│ │ │ └── web.xml
│ │ └── index.jsp
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── github/
│ └── tencent/
│ ├── AbstractReplaceCallBack.java
│ ├── HttpServletResponseCopier.java
│ ├── ReplaceCallBack.java
│ ├── ServletOutputStreamCopier.java
│ ├── SonicFilter.java
│ └── SonicUtil.java
├── sonic-nodejs/
│ ├── .gitignore
│ ├── README.md
│ ├── README_CN.md
│ ├── app.js
│ ├── assets/
│ │ ├── build/
│ │ │ └── gulpfile.js
│ │ ├── package.json
│ │ ├── page/
│ │ │ ├── demo1.ejs
│ │ │ ├── demo1.js
│ │ │ ├── demo2-data.js
│ │ │ ├── demo2.ejs
│ │ │ ├── demo2.js
│ │ │ ├── demo3-data.js
│ │ │ ├── demo3.ejs
│ │ │ ├── demo3.js
│ │ │ ├── index.ejs
│ │ │ ├── index.js
│ │ │ └── tpls/
│ │ │ ├── common_body_header.ejs
│ │ │ ├── common_body_header.js
│ │ │ ├── common_header.ejs
│ │ │ ├── common_header.js
│ │ │ ├── common_meta.ejs
│ │ │ └── common_meta.js
│ │ └── project.config.js
│ ├── common/
│ │ └── diff.js
│ ├── middleware/
│ │ └── compress.js
│ ├── package.json
│ └── router/
│ ├── config.js
│ └── index.js
├── sonic-php/
│ ├── README.md
│ ├── sample/
│ │ ├── README.md
│ │ ├── controller/
│ │ │ └── demo.php
│ │ ├── index.php
│ │ ├── js/
│ │ │ └── sonic-3.js
│ │ ├── util/
│ │ │ └── sonic.php
│ │ └── view/
│ │ └── demo_template.php
│ └── sdk/
│ └── sonic.php
└── sonic-react/
├── README.md
├── README_CN.md
├── components/
│ ├── GameArea.js
│ ├── GameFooter.js
│ └── GameHeader.js
├── containers/
│ └── GameContainer.js
├── package.json
├── pages/
│ └── demo.js
├── redux/
│ └── duck.js
├── server.js
└── static/
└── js/
└── flexible.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# MacOS
.DS_Store
# Windows
*.txt
.idea/
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to VasSonic
Welcome to [report Issues](https://github.com/Tencent/VasSonic/issues) or [pull requests](https://github.com/Tencent/VasSonic/pulls). It's recommended to read the following Contributing Guide first before contributing.
## Issues
We use Github Issues to track public bugs and feature requests.
### Search Known Issues First
Please search the existing issues to see if any similar issue or feature request has already been filed. You should make sure your issue isn't redundant.
### Reporting New Issues
If you open an issue, the more information the better. Such as detailed description, screenshot or video of your problem, logcat or code blocks for your crash.
## Pull Requests
We strongly welcome your pull request to make VasSonic better.
### Branch Management
There are two main branches here:
1. `master` branch.
1. It is the latest (pre-)release branch. We use `master` for tags, with version number `1.1.0`, `1.2.0`, `1.3.0`...
2. **Don't submit any PR on `master` branch.**
2. `dev` branch.
1. It is our stable developing branch. After full testing, `dev` will be merged to `master` branch for the next release.
2. **You are recommended to submit bugfix or feature PR on `dev` branch.**
Normal bugfix or feature request should be submitted to `dev` branch. After full testing, we will merge them to `master` branch for the next release.
```
master
↑
dev
↑
feature/bugfix PR
```
### Make Pull Requests
The code team will monitor all pull request, we run some code check and test on it. After all tests passed, we will accecpt this PR. But it won't merge to `master` branch at once, which have some delay.
Before submitting a pull request, please make sure the followings are done:
1. Fork the repo and create your branch from `master`.
2. Update code or documentation if you have changed APIs.
3. Add the copyright notice to the top of any new files you've added.
4. Check your code lints and checkstyles.
5. Test and test again your code.
6. Now, you can submit your pull request on `dev`.
## Code Style Guide
Use [Code Style](https://github.com/Tencent/VasSonic/blob/master/checkstyle.xml) for Java and Android.
* 4 spaces for indentation rather than tabs
## License
By contributing to VasSonic, you agree that your contributions will be licensed
under its [BSD LICENSE](https://github.com/Tencent/VasSonic/blob/master/LICENSE)
================================================
FILE: ISSUE_TEMPLATE
================================================
What steps will reproduce the problem?
该问题的重现步骤是什么?
1.
2.
3.
What is the expected output? What do you see instead?
你期待的结果是什么?实际看到的又是什么?
What version of the product are you using? On what operating system?
你正在使用产品的哪个版本?在什么操作系统上?
Please provide any additional information below.
如果有的话,请在下面提供更多信息。
================================================
FILE: LICENSE
================================================
Tencent is pleased to support the open source community by making VasSonic available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
If you have downloaded a copy of the VasSonic binary from Tencent, please note that the VasSonic binary is licensed under the
BSD 3-Clause License.
If you have downloaded a copy of the VasSonic source code from Tencent, please note that VasSonic source code is licensed under
the BSD 3-Clause License, except for the third-party components listed below which are subject to different license terms.
Your integration of VasSonic into your own projects may require compliance with the BSD 3-Clause License, as well as the other
licenses applicable to the third-party components included within VasSonic.
A copy of the BSD 3-Clause License is included in this file.
Other dependencies and licenses:
Open Source Software Licensed Under the Apache License, Version 2.0:
----------------------------------------------------------------------------------------
1. Android Source Code 4.4_r1
Copyright (C) 2005-2015 The Android Open Source Project
Terms of the Apache License, Version 2.0:
--------------------------------------------------------------------
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
“License” shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9
of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities that control, are controlled by, or are
under common control with that entity. For the purposes of this definition, “control” means (i) the power, direct or indirect,
to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
or more of the outstanding shares, or (iii) beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including but not limited to software source code,
documentation source, and configuration files.
“Object” form shall mean any form resulting from mechanical transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by
a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for
which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.
For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name)
to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version of the Work and any modifications or
additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the
copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this
definition, “submitted” means any form of electronic, verbal, or written communication sent to the Licensor or its representatives,
including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems
that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor
and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims
licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including
a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You meet the following conditions:
a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
b) You must cause any modified files to carry prominent notices stating that You changed the files; and
c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark,
and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
d) If the Work includes a “NOTICE” text file as part of its distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain
to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated
by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational
purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute,
alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the
Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of
the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of
the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor
provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated
with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor
be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as
a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been
advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with
this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility,
not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for
any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or
additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by
brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the
appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included
on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Terms of the BSD 3-Clause License:
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
3. Neither the name of [copyright holder] nor the names of its contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
## VasSonic: A Lightweight And High-performance Hybrid Framework
[](https://github.com/Tencent/VasSonic/blob/master/LICENSE)
[](https://github.com/Tencent/VasSonic/pulls)
[](https://github.com/Tencent/VasSonic/wiki)
---
<p align="center">
<img alt="logo" src="https://github.com/Tencent/VasSonic/blob/master/assets/logo.png"/>
</p>
VasSonic is a lightweight and high-performance Hybrid framework developed by tencent VAS team, which is intended to speed up the first screen of websites working on Android and iOS platform.
Not only does VasSonic supports the static or dynamic websites which are rendered by server, but it is also compatible with web offline resource perfectly.
VasSonic uses custom url connection instead of original network connection to request the index html, so it can request resource in advance or parallel to avoid waiting for the view initialization.
In this parallel case, VasSonic can read and render partial data by WebKit or Blink kernel without spending too much time waiting for the end of data stream.
VasSonic can cache html cleverly according to VasSonic Specification obeyed by client and server.
VasSonic Specification specify template and data by inserting different comment anchor, templates are bigger parts of html which stay the same or changed rarely , in contradiction data, which is the smaller and constantly change part of html.
According to this, VasSonic request less data by incremental updating templates and data, the websites are faster and feel more like native application.
In conclusion, VasSonic effectively enhance the user experience and increase click rate, retention rate and other indicators.
Sonic is called for short in project.
### Before VS After Using VasSonic
Pic 1: Before Using VasSonic | Pic 2: After Using VasSonic
:-------------------------:|:-------------------------:
![default mode][1] | ![VasSonic mode][2]
## Getting started
[Getting started with Android](https://github.com/Tencent/VasSonic/blob/master/sonic-android/README.md)
[Getting started with iOS](https://github.com/Tencent/VasSonic/blob/master/sonic-iOS/README.md)
[Getting started with Java](https://github.com/Tencent/VasSonic/blob/dev/sonic-java/README.md)
[Getting started with Node.js](https://github.com/Tencent/VasSonic/blob/master/sonic-nodejs/README.md)
[Getting started with PHP](https://github.com/Tencent/VasSonic/blob/master/sonic-php/README.md)
[Getting started with React](https://github.com/Tencent/VasSonic/blob/master/sonic-react/README.md)
## Demo Downloads
1. [Here](https://github.com/Tencent/VasSonic/releases) are the latest sample demo for Android and iOS.
## Support
Any problem?
1. Learn more from the following sample. </br>
[Android sample](https://github.com/Tencent/VasSonic/tree/master/sonic-android/sample) </br>
[iOS sample](https://github.com/Tencent/VasSonic/tree/master/sonic-iOS/SonicSample) </br>
[Java sample](https://github.com/Tencent/VasSonic/tree/dev/sonic-java/sample/webapp) </br>
[Node.js sample](https://github.com/Tencent/VasSonic/tree/master/sonic-nodejs) </br>
[PHP sample](https://github.com/Tencent/VasSonic/tree/master/sonic-php/sample) </br>
[React sample](https://github.com/Tencent/VasSonic/tree/master/sonic-react) </br>
2. Read the following source code </br>
[Android source code](https://github.com/Tencent/VasSonic/tree/master/sonic-android/sdk) </br>
[iOS source code](https://github.com/Tencent/VasSonic/tree/master/sonic-iOS/Sonic) </br>
[Java source code](https://github.com/Tencent/VasSonic/tree/dev/sonic-java/src/main/java/com/github/tencent)
[Node.js source code](https://github.com/Tencent/VasSonic/tree/master/sonic-nodejs) </br>
[PHP source code](https://github.com/Tencent/VasSonic/tree/master/sonic-php/sdk) </br>
[React source code](https://github.com/Tencent/VasSonic/tree/master/sonic-react) </br>
3. Read the [wiki](https://github.com/Tencent/VasSonic/wiki) for help.
4. Contact [us](https://jq.qq.com/?_wv=1027&k=4EaxB4K) or scan QR code for help.</br>
![QR code][3]
## Contributing
For more information about contributing issues or pull requests, see our [VasSonic Contributing Guide](https://github.com/Tencent/VasSonic/blob/master/CONTRIBUTING.md).
## License
VasSonic is under the BSD license. See the [LICENSE](https://github.com/Tencent/VasSonic/blob/master/LICENSE) file for details.
## The End
If you are interested in VasSonic, don't forget to STAR [it](https://github.com/Tencent/VasSonic).
VasSonic's mission is MAKING WEB MUCH BETTER!
Thank you for reading ~
[1]: https://github.com/Tencent/VasSonic/blob/master/assets/20170705120005424.gif
[2]: https://github.com/Tencent/VasSonic/blob/master/assets/20170705120029897.gif
[3]: https://github.com/Tencent/VasSonic/blob/master/assets/QR.JPG
[4]: https://github.com/Tencent/VasSonic/blob/master/assets/logo.png
================================================
FILE: assets/Sonic2.0.md
================================================
Sonic 2.0相比1.0,主要新增了以下几个特性:
* 支持纯终端模式(Local Server模式),在该模式下无需后台配合亦可完成秒开;
* 支持自定义请求头和自定义响应头;
* 支持Cache-Control来控制缓存生命周期;
* 支持非utf-8编码。
# Local Server模式
## Local Server模式介绍
Local Server模式是Sonic 2.0新增的纯终端模式,相比于Sonic 1.0需要终端、前端、后台全部改造接入Sonic,Local Server模式可以在业务后台无法及时支持时,通过终端模拟Server实现Sonic逻辑,从而降低接入成本。
Local Server的开启方式如下:
SonicSessionConfig.Builder sessionConfigBuilder = new SonicSessionConfig.Builder();
sessionConfigBuilder.setSupportLocalServer(true);
sessionConfigBuilder.build();
开启Local Server模式后,对于一般页面的请求,Sonic会模拟Sonic后台,对返回的页面数据进行eTag的计算,以及模板和数据的拆分,对比本地缓存的数据,添加sonic响应头(eTag、template-change、template-tag)。最后根据Server数据和本地缓存数据的对比结果,来决定此次请求模式是完全缓存、局部刷新还是模板更新,从而执行不同的刷新逻辑。后台无需接入sonic,也能体验页面秒开。
## Local Server执行流程
### 1、首次请求
首次请求也就是无缓存情况下发起的请求,与普通Sonic无缓存模式流程一致。具体细节可参考QuickSonicSession和StandardSonicSession的无缓存模式流程。
### 2、非首次请求
非首次请求也就是有缓存情况下发起的请求,分为完全缓存、局部刷新、模板变更三种情况。
#### (1) 完全缓存
完全缓存就是本地的数据跟服务器的数据是完全一样的。以Quick模式为例,Local Server的执行流程如下图:

上图主要展示了两条并行线,左边是在主线程执行的Webview流程,右边是在子线程执行Sonic流程。
**Sonic线程:**
Sonic会话创建完成后,首先获取url对应的本地缓存数据,并通知主线程Webview加载该数据。接着Sonic会与Server建立连接,如果Server返回304,则Server数据没有变更,直接使用本地缓存,Sonic流程结束;否则,Sonic拉取到完整的Server数据,计算其SHA1作为eTag,如果与请求头中的eTag相同,就确定本次请求是完全缓存模式,Sonic流程结束。
**主线程:**
主线程在收到Sonic通知后,加载本地缓存数据,交给Webview渲染。
#### (2) 局部刷新
局部刷新就是本地的数据跟服务器的数据相比,只有data部分有变化,模板与服务器一样。

**Sonic线程:**
Sonic会话创建完成后,首先获取url对应的本地缓存数据,并通知主线程Webview加载该数据。接着Sonic与Server建立连接,读取到完整的Server数据,计算其SHA1作为eTag,如果与请求头中的eTag不同,Sonic将Server数据拆分为template和data,计算template的SHA1作为template-tag,如果与请求头中的template-tag相同,则说明模板没有变更,此时确定本次请求是局部刷新,将拆分得到的data与本地保存的data做对比计算,得到增量数据。最后通知Webview进行局部刷新,并更新本地缓存。
**主线程:**
局部刷新模式下主线程会先收到加载本地缓存数据的通知,而Sonic线程通知主线程刷新data时,主线程可能还未开始加载本地缓存,也可能已经开始渲染本地缓存。如果WebView还未开始加载本地缓存,就会直接加载最新的数据(拆分得到的data跟本地模版合成的数据);如果主线程已经加载本地缓存,就会直接通过Js接口让WebView用增量数据刷新页面。
#### (3) 模板更新
模板更新是本地的模板跟服务器的模板不一致。

**Sonic线程:**
Sonic会话创建完成后,首先获取url对应的本地缓存数据,并通知主线程Webview加载该数据。接着Sonic与Server建立连接,读取到完整的Server数据,计算其SHA1作为eTag,如果与请求头中的eTag不同,Sonic将Server数据拆分为template和data,计算template的SHA1作为template-tag,如果与请求头中的template-tag不同则说明模板发生了变更,此时确定本次请求是模板刷新模式,通知主线程Webview进行模板刷新,并更新本地缓存。
**主线程:**
主线程会先收到加载本地缓存数据的通知,之后Sonic线程通知主线程进行模板刷新时,无论WebView是否已经开始加载本地缓存数据,都会直接重新加载最新的Server数据,完成模板刷新。
# 其他新增特性
### 1、支持自定义请求头和自定义响应头
Sonic 2.0支持添加自定义请求头和自定义响应头,添加方式如下:
SonicSessionConfig.Builder sessionConfigBuilder = new SonicSessionConfig.Builder();
sessionConfigBuilder.setCustomRequestHeaders(requestHeaderMap);
sessionConfigBuilder.setCustomResponseHeaders(responseHeaderMap);
sessionConfigBuilder.build();
### 2、支持Cache-Control来控制缓存生命周期
Sonic 2.0支持在Http响应头部添加Cache-Control字段来控制缓存生命周期,目前支持max-age、private、public三个可选值。
### 3、支持非UTF-8编码
Sonic 2.0优化了字符编码的使用。如果http响应头中包含"Content-Type"字段,则优先使用该字段的值作为字符编码,否则默认使用UTF-8编码。
# FAQ
### 1、Sonic后台返回的数据与非sonic后台返回的数据的区别?
接入了Sonic的Server返回的数据,http响应头会包含"cache-offline"、"template-change"或者"template-tag"字段,而未接入Sonic的Server返回的数据,响应头中不会包含以上三个字段。
### 2、Local Server模式的优缺点?
**优点:**
Local Server模式下,简化了终端执行逻辑;而且无需后台接入Sonic,大大减少了接入成本。
**缺点:**
Local Server模式相比后台接入,损失了一定的性能。因为终端模拟后台的话,非首次请求场景需要等Server数据全部返回才能计算eTag,template-tag,template-change,从而判断是哪种模式(完全缓存、局部刷新还是模板更新)。
================================================
FILE: assets/VasSonic3.0_preload.md
================================================
# Sonic 3.0 子资源预下载功能特性介绍
## 1 子资源预下载
VasSonic中子资源预下载功能的灵感就来源于Chrome中的\<link rel='preload'/>。
> \<link rel='preload'/>:\<link>元素的rel属性的属性值preload能够让你在你的HTML页面中\<head>元素内部书写一些声明式的资源获取请求,可以指明哪些资源是在页面加载完成后即刻需要的。对于这种即刻需要的资源,你可能希望在页面加载的生命周期的早期阶段就开始获取,在浏览器的主渲染机制介入前就进行预加载。这一机制使得资源可以更早的得到加载并可用,且更不易阻塞页面的初步渲染,进而提升性能。
### 1.1 子资源预下载开启方式
想要开启VasSonic 3.0中的子资源预下载功能,需要终端或者后台参与。在请求主资源时,由后台在Response Header中添加一个名为```sonic-link```的响应头部字段,这个字段的值指定了期望得到预下载的子资源,不同的子资源url之间由";"区分。可以预下载的子资源类型包括图片、css样式文件、js脚本文件等等。示例如下:
```http
sonic-link: http://test.js;http://test.css;http://test.jpg
```
除了后台返回```sonic-link```相应头,也可以通过终端指定```sonic-link```,方式如下:
```java
SonicSessionConfig.Builder sessionConfigBuilder = new SonicSessionConfig.Builder();
Map<String, String> headers = new HashMap<String, String>();
headers.put("sonic-link", "http://test.js;http://test.css;http://test.jpg");
sessionConfigBuilder.setCustomResponseHeaders(headers);
sessionConfigBuilder.build();
```
### 1.2 子资源预下载的流程说明
VasSonic检测到主资源响应头中的```sonic-link```字段时,子资源预下载模块就会开始工作,具体执行流程如下图:

1. 对```sonic-link```字段中的字资源进行下载是在单独的预下载线程中进行;
2. 当内核请求的子资源url不在```sonic-link```头中时,VasSonic不做处理,完全抛给内核;
3. 当内核请求的子资源url在```sonic-link```头中时,有以下四种情况:
- 如果对应的子资源有缓存且缓存不过期,则直接加载该缓存;
- 如果对应的子资源没有缓存,且子资源下载处于排队状态,抛给内核处理(Sonic仍会完成该资源的下载并进行缓存);
- 如果对应的子资源没有缓存,且子资源正在下载,则将已下载的内存数据和未下载的网络流数据组成桥接流给内核;
- 如果对应的子资源没有缓存,且子资源已下载完成,则将下载完成的子资源数据给内核。
### 1.3 子资源缓存相关
子资源完成预下载之后会在本地进行缓存,缓存规则如下:
1. 子资源数据和子资源响应头数据会分别进行缓存,子资源url的MD5作为子资源数据缓存文件名,子资源url的MD5.header作为子资源响应头缓存的文件名。
2. 子资源和子资源响应头的缓存数据都保存在```/sdcard/SonicResource/```目录下;
2. 子资源缓存的过期过期时间由```sonic-link```头中子资源url参数```max-age```唯一决定;
3. 一旦本地子资源缓存被恶意篡改,被篡改过的子资源不会通过VasSonic校验,该缓存会被删除;
4. 默认每隔24小时进行一次缓存检查,如果超过大小限制(默认60M,可设置),会进行一次缓存清理。
使用如下方式进行缓存相关设置:
```java
SonicConfig.Builder builder = new SonicConfig.Builder();
// 设置缓存校验方式为校验文件大小,默认为对文件内容进行Sha1校验
builder.setCacheVerifyWithSha1(false);
// 设置子资源缓存最大为100M,默认为60M
builder.setResourceCacheMaxSize(100 * 1024 * 1024);
// 设置缓存大小检查时间间隔为12小时,默认为24小时
builder.setCacheCheckTimeInterval(12 * 60 * 60 * 1000L);
builder.build();
```
================================================
FILE: assets/sonic发展历程.md
================================================
# VasSonic成长历程
## 1.前言
2017年8月8日,腾讯SNG增值产品部技术团队(以下简称VAS)研发的轻量级高性能Hybrid框架VasSonic通过了公司最终审核,作为腾讯开源组件的一份子分享给大家。从当初立项优化页面加载速度,到不断摸索、优化,再到整理代码、文档,最终在Github上开源,并且在24小时内获取star数超过1600。我们非常高兴看到我们的成果收到这么多的关注,趁此机会,正好回顾一下VasSonic的成长历程,也希望能够让大家更了解VasSonic。
## 2.项目背景
Web相信大家再熟悉不过了,它具有快速迭代发布的天然优势,但也存在一些让人诟病的问题,比如加载速度慢,体验差等。在此之前,手Q上很多页面首屏打开速度居高不下,甚至有些耗时达到3s以上,这意味着用户打开页面必须经过3秒之后才能进行交互操作,体验相当差,很多用户忍受不了这个漫长的时间直接流失掉了。
为了提升用户体验和业务用户留存率,我们很多业务一开始通过Web开发,等页面模型验证符合预期后,再将H5页面转化成原生界面。我们很快意识到这不是一种健康的可持续的开发模式,一方面存在重复人力浪费,另外一方面原生商城除了速度快一点,要运营活动改版都很难。
所以后来团队改了切入方向,安排人力专心研究如何加快页面打开速度。经过了一系列的摸爬滚打和优化探索,最终我们研发出了VasSonic框架,让H5页面首屏达到秒开,给用户一个更好的H5体验。期间也曾和空间技术团队共同合作将空间的首屏优化方案wns-html引入到手Q中(共同命名为webso方案)进行尝试,虽然在我们业务使用过程中存在部分场景体验较差,但webso中页面模板和数据分离等思路给VasSonic框架的发展提供了很好的帮助,在此特别感谢webso技术团队的贡献。下面就和大家分享VasSonic框架的发展历程。
## 3.业务形态
任何一个技术框架都是结合具体的业务形态来进行发展优化的,技术是为了更好地服务业务,业务也会驱动技术的发展。因此在此首先介绍一下业务形态,我们是来自手Q增值产品部门的VAS团队,负责手机QQ上很多深受年轻人喜欢的个性化增值服务,比如气泡、挂件、主题等等。手Q上大部分的业务还是基于H5开发的,大家对手Q的业务形态可能有简单的了解。比如游戏分发中心、会员特权中心、个性化装扮商城等。这部分商城的特点比较明显,页面的很多数据都是动态的,是由我们的产品经理在后台配置的。

这些都是很常见页面,我们通常将html/js/css等静态资源放到CDN上,然后页面加载后,再通过CGI去拉取最新的数据,进行拼接展示, 这样子可以利用到CDN的多地部署和就近接入等优势,同时提高了服务器的并发能力。这种传统模式的加载流程如下所示: </br>

1. 用户点击后,经过终端一系列初始化流程,比如进程启动、Runtime初始化、创建WebView等等。
2. 完成初始化后,WebView开始去CDN上面请求Html加载页面。
3. 页面发起CGI请求对应的数据或者通过localStorage获取数据,数据回来后再对DOM进行操作更新
可以看出上述流程存在着几个问题:

1. 从外网统计数据来看,用户的终端耗时在1s以上,这意味着在这1s多的时间里,网络完全是空闲在等待的,非常浪费;
2. 页面的资源和数据完全依赖于网络,特别是用户在弱网络场景下,页面会出现很长时间的白屏,体验非常差;
3. 因为页面的数据依赖于动态拉取,加载完页面后,往往是看到一些模块先转菊花,再展示,体验也是不好的。同时这里涉及到较多数据更新,经常要更新DOM,性能上也有不少开销。
所以针对以上几个问题,我们也对应做了很多优化和探索。
## 4.VasSonic的前世
基于传统模式的加载流程存在的种种问题,我们做了以下优化:
### 4.1 终端优化
针对终端耗时1s以上的情况,我们对手Q WebView框架进行了重构:
1. 启动流程彻底拆分,设计为一个状态机按序按需执行
2. View相关拆分模块化设计,尽可能懒加载,IO异步化
3. X5内核在手Q中的独立进程中提前预加载
4. 创建WebView对象复用池
关于第四点,我们想分享一些Android平台上的细节,由于Android系统的生态原因,导致用户的系统版本和系统Webkit内核处于极其分裂状态,所以我们公司在手Q和微信统一使用X5内核。相对系统WebView来说,首次启动X5内核时,创建WebView比较耗时,因此我们尽量想复用WebView,但是WebView却是与Activity Context绑定。销毁复用的时候,需要释放Activity的Context,否则会内存泄露。针对这种情况,有没有一种两全其美的办法呢?
计算机有一句经典的名言:```计算机领域任何一个问题都可以通过引入中间层来解决```。于是我们通过包装的方式,实现了一个Context的壳,真正的实现体包装在里面,逻辑调用真正调用到对应的实现体的函数。 经过实验发现,Android系统本身提供了这么一个```MutableContextWrapper```,作为Context的一个中间层。
我们会将Activity context包在MutableContextWrapper里面,destory的时候,会将WebView的Context设置为Application的Context,从而释放Activity Context。
类似如下:
```Java
//precreate WebView
MutableContextWrapper contextWrapper = new MutableContextWrapper(BaseApplicationImpl.sApplication);
mPool[0] = new WebView(contextWrapper);
//reset WebView
ct =(MutableContextWrapper)webview.getContext();
ct.setBaseContext(getApplication());
//reuse WebView
((MutableContextWrapper)webview.getContext()).setBaseContext(activityContext);
```
### 4.2 静态直出

“直出”这个概念对前端同学来说,并不陌生。为了优化首屏体验,大部分主流的页面都会在服务器端拉取首屏数据后通过NodeJs进行渲染,然后生成一个包含了首屏数据的Html文件,这样子展示首屏的时候,就可以解决内容转菊花的问题了。
当然这种页面“直出”的方式也会带来一个问题,服务器需要拉取首屏数据,意味着服务端处理耗时增加。
不过因为现在Html都会发布到CDN上,WebView直接从CDN上面获取,这块耗时没有对用户造成影响。
手Q里面有一套自动化的构建系统Vnues,当产品经理修改数据发布后,可以一键启动构建任务,Vnues系统就会自动同步最新的代码和数据,然后生成新的含首屏Html,并发布到CDN上面去。
### 4.3 离线预推

页面发布到CDN上面去后,那么WebView需要发起网络请求去拉取。当用户在弱网络或者网速比较差的环境下,这个加载时间会很长。于是我们通过离线预推的方式,把页面的资源提前拉取到本地,当用户加载资源的时候,相当于从本地加载,即使没有网络,也能展示首屏页面。这个也就是大家熟悉的离线包。
手Q使用7Z生成离线包, 同时离线包服务器将新的离线包跟业务对应的历史离线包进行BsDiff做二进制差分,生成增量包,进一步降低下载离线包时的带宽成本,下载所消耗的流量从一个完整的离线包(253KB)降低为一个增量包(3KB)。
经过一系列优化后,在Android平台上,点击到页面首屏展示的耗时从平均*3s*多降低为*1.8s*,优化*40% 以上*。

所以针对以上几个问题,我们对应做了很多优化和探索,这些优化帮助我们形成VasSonic的最初构想。
### 4.4 业务形态变化
虽然通过静态直出和离线预推等方式优化后,速度已经达到1.8s,但还存在很大的优化空间,当我们准备持续深入优化时,我们的业务形态发生了新的变化。
之前我们页面内容的数据主要是由产品经理要配置的,用户看到的内容基本都是一样的。而现在页面为了更好地为用户推荐喜欢的内容,我们后台引入机器学习和随机算法来做智能个性化推荐。比如左边新用户推荐的是新货精选,而右边活跃用户展示的是潮品推荐。另外还有部分的内容是随机算法推荐的。这意味着不同用户看到的内容是不同的,同一个用户不同时间看到的内容也有可能不同。

### 4.5 动态直出
所以为了满足业务的需求,我们只能实时拉取用户数据并在服务端渲染后返回给客户端,也就是动态直出的方案。
但是动态直出方案存在几个比较明显的问题:
1. 服务端实时拉取数据渲染导致白屏时间长,因为服务器要先实时拉取个人数据,然后进行渲染直出,这个耗时不可控;
2. 首屏无法使用离线预推等缓存策略,因为每个用户看到的内容不一样,我们无法通过静态直出的方式那样把Html全部发布到CDN;
虽然动态直出方案下,页面首屏无法通过离线预推等方式进行加载优化,但前面离线包优化积累的经验给我们提供了思路:要优化白屏问题,核心还是减少对网络的依赖,加速资源加载方向入手。所以,此时的技术挑战为:如何缓存动态直出页面和如何在缓存页面的基础上更新页面。(注:动态直出页面可能内部有用户实时数据,不更新页面会导致看到过时的数据导致投诉)。
### 4.6 webso的尝试
在我们准备进一步优化的时候,了解到了QQ空间技术团队在动态直出方面做的一些实践尝试,他们提出了wns+html的解决方案:通过主动缓存首屏数据来获得加速,于是我们和QQ空间技术团队一起进行优化合作,将wns+html的解决方引入到手Q平台并命名为webso,其原理如图:
![image.png-103.9kB][1]
但我们使用过程中,发现页面在首次加载和模板变更场景加载耗时比较高,且在页面有内容变化的场景下需要重刷整个页面,对于变化频繁的页面体验较差,特别是在低端安卓机器上,白屏过程非常明显。于是我们分析背后的原因,发现主要有以下几个问题:
1、采用了sso+wns腾讯私有协议传输,虽然节省了服务器连接耗时,但需要经过跨进程、服务器中转、信令排队、加解密等步骤,导致传输效率变差(注:传输通道由之前的http->node.js变成了ipc->sso->wns->wns-proxy->node.js,同时也增加了额外的代理服务器和排查定位问题成本);
2、需要下载完整模板和数据并拼接html之后才能交给内核渲染,在内容没有完整下载之前,内核无法进行渲染,处于空闲等待状态,与内核边加载边渲染的特性冲突;
3、页面一旦发生内容变化(模板和数据),需要进行合并html重刷整个页面(或下次展示),无法进行局部刷新,仅更新变化的元素节点。
综上,webso方案更加适合变化较少的简单页面,无法满足我们业务变化频繁的场景(每次进入页面数据都有变化,我们的产品和用户都无法接受重刷页面的体验)。于是我们需要一个新的通用的解决方案,通过深入内核分析结合内核特性和不断的优化探索,最终提出了更轻量更高性能的解决方案:VasSonic。
## 5. VasSonic的诞生
接下来详细介绍VasSonic的解决方案
### 5.1 并行加载
首先在加载流程方面,我们发现这里WebView访问依然是串行的, WebView要等终端初始化完成之后,才发起请求。虽然终端耗时优化了不少,但是从外网的统计数据来看,终端初始化还是存在几百毫秒的耗时,而这段时间内网络是在空等的。
(注:在传输通道方面,我们选择了标准的http/https通道,原因是http/https通道支持流式传输,也支持chunk等特性,同时接入成本低,更加通用。)

因此性能上不够极致,我们优化代码,这两个操作并行处理,流程改为:

并行处理后速度有所改善,但我们发现在某些场景下,终端初始化比较快,但数据没有完成返回,这意味着内核在空等,而内核是支持边加载边渲染的,我们在并行的同时,能否也利用内核的这个特性呢?
于是我们加入了一个中间层来桥接内核和数据,内部称为流式拦截:

1. 启动子线程请求页面主资源,子线程中不断讲网络数据读取到内存中,也就是网络流(NetStream)和内存流(MemStream)之间的转换;
2. 当WebView初始化完成的时候,提供一个中间层BridgeStream来连接WebView和数据流;
3. 当WebView读取数据的时候,中间层BridgeStream会先把内存的数据读取返回后,再继续读取网络的数据。
通过这种桥接流的方式,整个内核无需等待,继续做到边加载边解析。这种并行的方式让首屏的速度优化*15%以上*,进一步提升了页面加载速度。
### 5.2 动态缓存
通过并行加载,我们极大地提升了WebView请求的速度,但是在弱网络场景下白屏时间还是非常长,用户体验非常糟糕。基于离线包和webso方案的优化实践经验,我们首先将用户的已经加载的页面内容缓存下来,等用户下此点击页面的时候,我们先加载展示页面缓存,第一时间让用户看到内容,然后同时去请求新的页面数据,等新的页面数据拉取下来之后,我们再重新加载一遍即可。

保存页面内容这个工作很简单,因为现在我们资源读取都是通过中间层BridgeStream来管理的,只需要将整个读取的内容缓存下来即可。
于是我们就按动态缓存这种方案去实现了,但很快就发现了问题。用户打开页面之后,先是看到历史页面,等用户准备去操作的时候,突然页面白闪一下,重新加载了一遍,这种体验非常差,特别在一些低端机器上,这个白闪的过程太明显,非常影响体验,这是用户和产品经理都不能接受的。于是我们在思考,能否只做局部的刷新,仅刷新变化的元素呢?
通过分析,我们发现同一个用户的页面,大部分数据都是不变的,经常变化的只有少量数据,于是我们提出了模板(template)和数据块(data)的概念:页面中经常变化的数据我们称为数据块,除了数据块之外的数据称为模板。
### 5.3 页面分离
在页面分离这块,我们沿用了webso方案中的动静分离的思想,并扩展了部分新的字段。首先我们将整个页面html通过VasSonic标签进行划分,包裹在标签中的内容为data,标签外的内容为模版。

首先我们对Html内容进行了扩展,通过代码注释的方式,增加了“sonicdiff-xxx”来标注一个数据块的开始与结束。
而模板就是将数据块抠掉之后的Html,然后通过{albums}来表示这个是一个数据块占位。
数据就是JSON格式,直接Key-Value。
当然,为了完美地兼容Html,我们对协议头部进行了扩展,比如增加accept-diff来标注是否支持增量更新、template-tag来标注模板的md5是多少等。OK,有了上面这个规则或者公式后,我们就可以实现增量更新了。
### 5.4 请求规范约定
VasSonic为了支持区分客户端是否支持增量更新等能力,对头部字段进行了扩展
字段 | 说明 | 请求头(Y/N) | 响应头(Y/N)
:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:
accept-diff | 表示终端是否支持VasSonic模式,true为支持,否则不支持 | Y | N
If-none-match | 本地缓存的etag,给服务端判断是否命中304 | Y | N
etag | 页面内容的唯一标识(哈希值) | N | Y
template-tag | 模版唯一标识(哈希值),客户端使用本地校验 或 服务端使用判断是模板有变更 | Y | Y
template-change | 标记模版是否变更,客户端使用 | N | Y
cache-offline | 客户端端使用,根据不同类型进行不同行为 | N |Y
### 5.5 cache-offline字段说明
字段 | 说明
:-------------------------:|:-------------------------:
true | 缓存到磁盘并展示返回内容
false | 展示返回内容,无需缓存到磁盘
store | 缓存到磁盘,如果已经加载缓存,则下次加载,否则展示返回内容
http | 容灾字段,如果http表示终端六个小时之内不会采用sonic请求该URL
### 5.6 模式介绍
VasSonic根据本地是否有缓存以及本地缓存数据跟服务器数据的差异情况分为以下四种模式。
模式 | 说明 | 条件
:-------------------------:|:-------------------------:|:-------------------------:
**首次加载** | 本地没有缓存,即第一次加载页面 | etag为空值或template_tag为空值
**完全缓存** | 本地有缓存,且缓存内容跟服务器内容完全一样 | etag一致
**数据更新** | 本地有缓存,本地模版内容跟服务器模版内容一样,但数据块有变化 | etag不一致 且 template_tag一致
**模版更新** | 本地有缓存,缓存的模版内容跟服务器的模版内容不一样 | etag不一致 且 template_tag不一致
#### 首次加载
我们会在请求头部带上支持accept-diff为true和sdk版本号等标识着首次加载的信息。当请求返回后,VasSonic会在延迟几秒后(避免激烈IO竞争)将页面抽离成模板和数据并保存到本地。此时终端缓存目录下,该页面将对应三个缓存文件xxx.html、xxx.template、xxx.data,其中xxx是该页面的唯一标识(即sonicSessionId)。
对于页面非首次加载场景,VasSonic优先加载本地缓存, 同时我们会在请求头部带上当前缓存和模板的md5,后台进行模板md5对比之后,分为以下几种情况:
#### 非首次加载之完全缓存
本地有缓存,且缓存内容跟服务器内容完全一样.
#### 非首次加载之增量数据

如果模板发现没有变化,那么会在响应头部返回template-change=false,同时响应包体返回的数据不再是完整的html,而是一段JSON数据,及全部的数据块。我们现在需要跟本地数据进行差分,找出真正的增量数据,如上图中,后台返回了N个数据,实际上仅有一个数据是有变化的,那么我们仅需要将这个变化的数据提交到页面即可。一般场景下,这个差异的数据比全部数据要小很多。如果页面拆分数据得更细,那么页面的变动就更小,这个取决于前端同学对数据块的细化程度。
获得变化数据块(diff_data)后,客户端只需要通知页面页面设置的回调接口(getDiffDataCallback)进行界面元素更新即可。这里javascript的通信方式也可以自由定义(可以使用webview标准的javascript通信方式,也可以使用伪协议的方式),只要页面跟终端协商一致就可以。

对于数据更新这种场景,终端还会将新的数据和模板拼接成为新的页面,保持缓存最新。当终端初始化比较慢的时候,WebView去加载缓存的时候,这个页面可能已经是最新的了,连数据刷新都不需要。
#### 非首次加载之模板更新
与数据更新模式不一样,由于业务需求,页面的模板会发生更改。当终端在获取到新的模板和数据后,本地在子线程中进行合并,生成一个新的缓存,然后回调通知终端,刷新WebView来加载新的缓存。
我们来看一下最终的流程图,跟动态缓存对比,有不少细节优化:

我们从第2步开始,SonicSession首先会去读取缓存。会抛个消息通知WebView读取缓存,如果Webview已经准备好,则直接加载缓存,如果没有,则缓存先放在内存里面。同时SonicSession也会带上模板等信息到后台拉取新的内容,后台经过Sonic-Diff之后,会返回新的数据。SonicSession拿到新的数据后,首先会跟本地数据进行Diff,如果发现WebView已经加载缓存,则直接提交增量数据给页面。否则继续拼接最新的页面,替换掉内存里面的缓存,同时保存到本地。这个时候WebView如果Ready,则直接进行第5步load最新的内容即可。
#### 效果统计

这个是我们外网的统计数据。在数据更新模式下,首屏的耗时在1s左右,相比普通的动态直出,优化了50%以上。模板更新这个会比首次高,是因为加载了两次页面,不过从模式占比上来看,我们大部分页面都是数据更新。针对模板更新这种耗时比较高的情况,前面优化积累的经验给我们提供了思路,核心还是从提前获取资源方向入手,因此我们优先考虑如何预加载模板更新。
#### 预加载
实际上整个SonicSession在没有WebView的情况下,也是可以独立完成所有逻辑的,当用户点击页面的时候,我们在将WebView和SonicSession绑定起来即可。于是我们支持了两种预加载的模式,一种是通过后台push的方式,来提前获取数据。还有一种就是JSAPI,页面可以调用JSAPI来预加载用户可能操作的下一个页面。通过这两种方式,我们可以把需要的增量更新数据提前拉取回来

## 6. 效果对比
Pic 1: 没有使用VasSonic | Pic 2: 使用VasSonic
:-------------------------:|:-------------------------:
 | 
## 7. 展望未来
开源只是故事的开始,我们仍会持续对 VasSonic 做改进,包括更易用的接口、更好的性能、更高的可靠性,同时快速响应解决开源后的issue和PR。这些改进最终也会原封不动地在手Q内使用,这一切都是为了更快的WebView加载速度。 </br>
Talk is cheap,read the fucking code. If you are interested in VasSonic, don't forget to STAR [VasSonic](https://github.com/Tencent/VasSonic).
Thank you for reading ~
## 8. 特别感谢
最后再次感谢qq空间技术团队的贡献及webso技术带来的启发,感谢infoQ,腾讯开源,bugly等媒体团队对vasSonic的开源支持。
[1]: http://static.zybuluo.com/feilang/7l6ptf1cl5k3qxl0o55a4cxq/image.png
================================================
FILE: checkstyle.xml
================================================
<?xml version="1.0"?>
<!--
Copyright (C) 2016 THL A29 Limited, a Tencent company.
Copyright (C) 2014 Square, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!--module name="NewlineAtEndOfFile"/-->
<module name="FileLength"/>
<module name="FileTabCharacter"/>
<module name="SuppressWarningsFilter"/>
<!-- Trailing spaces -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<!-- Space after 'for' and 'if' -->
<module name="RegexpSingleline">
<property name="format" value="^\s*(for|if)[^ ]\("/>
<property name="message" value="Space needed before opening parenthesis."/>
</module>
<!-- For each spacing -->
<module name="RegexpSingleline">
<property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/>
<property name="message" value="Space needed around ':' character."/>
</module>
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<!--module name="JavadocMethod"/-->
<!--module name="JavadocType"/-->
<!--module name="JavadocVariable"/-->
<!--module name="JavadocStyle"/-->
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<!--<module name="ConstantName"/>-->
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName">
<property name="format" value="^[A-Z][a-zA-Z0-9_]*$"/>
</module>
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!--module name="LineLength"-->
<!--property name="max" value="100"/-->
<!--/module-->
<!--module name="MethodLength"/-->
<!--<module name="ParameterNumber"/>-->
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="GenericWhitespace"/>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<!--module name="ModifierOrder"/-->
<module name="RedundantModifier"/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<!--module name="AvoidNestedBlocks"/-->
<!--module name="EmptyBlock"/-->
<module name="LeftCurly"/>
<!--allow single line-->
<module name="NeedBraces">
<property name="allowSingleLineStatement" value="true"/>
</module>
<module name="RightCurly"/>
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!--module name="AvoidInlineConditionals"/-->
<module name="CovariantEquals"/>
<module name="EmptyStatement"/>
<!--module name="EqualsAvoidNull"/-->
<!--<module name="EqualsHashCode"/>-->
<!--module name="HiddenField"/-->
<module name="IllegalInstantiation"/>
<!--<module name="InnerAssignment"/>-->
<!--module name="MagicNumber"/-->
<!--<module name="MissingSwitchDefault"/>-->
<!--<module name="RedundantThrows"/>-->
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!--module name="DesignForExtension"/-->
<!--module name="FinalClass"/-->
<!--<module name="HideUtilityClassConstructor"/>-->
<!--module name="InterfaceIsType"/-->
<!--module name="VisibilityModifier"/-->
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<!--module name="FinalParameters"/-->
<!--<module name="TodoComment"/>-->
<module name="UpperEll"/>
<module name="SuppressWarningsHolder"/>
</module>
</module>
================================================
FILE: sonic-android/.gitignore
================================================
.gradle
/build
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
.DS_Store
node_modules
# Built application files
*.apk
*.ap_
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
*.iml
/*/*.iml
.idea
/*/.idea/
# Local configuration file (sdk path, etc)
local.properties
gradle.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
/*/.idea
/buildSdk
================================================
FILE: sonic-android/README.md
================================================
## Getting started with Android
[](https://github.com/Tencent/VasSonic/blob/master/LICENSE)
[](https://github.com/Tencent/VasSonic/pulls)
[](https://github.com/Tencent/VasSonic/wiki)
---
## Dependencies:
Add VasSonic gradle plugin as a dependency in your module's build.gradle
```gradle
compile 'com.tencent.sonic:sdk:3.1.0'
```
## Implement sonic interface:
1. Implement a class which extends from ```SonicRuntime```
> SonicRuntime is a class which interacts with the overall running information in the system, including Context, UA, ID (which is the unique identification for the saved data) and other information.
```Java
/**
* Here is a sample subclass of SonicRuntime
*/
public class HostSonicRuntime extends SonicRuntime {
public HostSonicRuntime(Context context) {
super(context);
}
/**
* @return User's UA
*/
@Override
public String getUserAgent() {
return "";
}
/**
* @return the ID of user.
*/
@Override
public String getCurrentUserAccount() {
return "";
}
/**
* @return the file path which is used to save Sonic caches.
*/
@Override
public File getSonicCacheDir() {
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "sonic/";
File file = new File(path.trim());
if(!file.exists()){
file.mkdir();
}
return file;
}
}
```
2. Implement a subclass which extends from ```SonicSessionClient```
```Java
/**
*
* SonicSessionClient is a thin API class that delegates its public API to a backend WebView class instance, such as loadUrl and loadDataWithBaseUrl.
*/
public class SonicSessionClientImpl extends SonicSessionClient {
private WebView webView;
public void bindWebView(WebView webView) {
this.webView = webView;
}
@Override
public void loadUrl(String url, Bundle extraData) {
webView.loadUrl(url);
}
@Override
public void loadDataWithBaseUrl(String baseUrl, String data, String mimeType, String encoding,
String historyUrl) {
webView.loadDataWithBaseURL(baseUrl, data, mimeType, encoding, historyUrl);
}
}
```
## Android Demo
Here is a simple demo shows how to create an Android activity which uses the VasSonic Framework
```Java
public class BrowserActivity extends Activity {
public final static String PARAM_URL = "param_url";
public final static String PARAM_MODE = "param_mode";
private SonicSession sonicSession;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
String url = intent.getStringExtra(PARAM_URL);
int mode = intent.getIntExtra(PARAM_MODE, -1);
if (TextUtils.isEmpty(url) || -1 == mode) {
finish();
return;
}
getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
// step 1: Initialize sonic engine if necessary, or maybe u can do this when application created
if (!SonicEngine.isGetInstanceAllowed()) {
SonicEngine.createInstance(new SonicRuntimeImpl(getApplication()), new SonicConfig.Builder().build());
}
SonicSessionClientImpl sonicSessionClient = null;
// step 2: Create SonicSession
sonicSession = SonicEngine.getInstance().createSession(url, new SonicSessionConfig.Builder().build());
if (null != sonicSession) {
sonicSession.bindClient(sonicSessionClient = new SonicSessionClientImpl());
} else {
// this only happen when a same sonic session is already running,
// u can comment following codes to feedback as a default mode.
throw new UnknownError("create session fail!");
}
// step 3: BindWebView for sessionClient and bindClient for SonicSession
// in the real world, the init flow may cost a long time as startup
// runtime、init configs....
setContentView(R.layout.activity_browser);
WebView webView = (WebView) findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if (sonicSession != null) {
sonicSession.getSessionClient().pageFinish(url);
}
}
@TargetApi(21)
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
return shouldInterceptRequest(view, request.getUrl().toString());
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
if (sonicSession != null) {
//step 6: Call sessionClient.requestResource when host allow the application
// to return the local data .
return (WebResourceResponse) sonicSession.getSessionClient().requestResource(url);
}
return null;
}
});
WebSettings webSettings = webView.getSettings();
// step 4: bind javascript
// note:if api level lower than 17(android 4.2), addJavascriptInterface has security
// issue, please use x5 or see https://developer.android.com/reference/android/webkit/
// WebView.html#addJavascriptInterface(java.lang.Object, java.lang.String)
webSettings.setJavaScriptEnabled(true);
webView.removeJavascriptInterface("searchBoxJavaBridge_");
intent.putExtra(SonicJavaScriptInterface.PARAM_LOAD_URL_TIME, System.currentTimeMillis());
webView.addJavascriptInterface(new SonicJavaScriptInterface(sonicSessionClient, intent), "sonic");
// init webview settings
webSettings.setAllowContentAccess(true);
webSettings.setDatabaseEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setAppCacheEnabled(true);
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
// step 5: webview is ready now, just tell session client to bind
if (sonicSessionClient != null) {
sonicSessionClient.bindWebView(webView);
sonicSessionClient.clientReady();
} else { // default mode
webView.loadUrl(url);
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
@Override
protected void onDestroy() {
if (null != sonicSession) {
sonicSession.destroy();
sonicSession = null;
}
super.onDestroy();
}
```
## Support
Any problem?
1. Learn more from [sample](https://github.com/Tencent/VasSonic/tree/master/sonic-android/sample).
4. Contact us for help.
## License
VasSonic is under the BSD license. See the [LICENSE](https://github.com/Tencent/VasSonic/blob/master/LICENSE) file for details.
[1]: https://github.com/Tencent/VasSonic/blob/master/article/20170705120005424.gif
[2]: https://github.com/Tencent/VasSonic/blob/master/article/20170705120029897.gif
================================================
FILE: sonic-android/build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: sonic-android/docs/Sonic Quick模式实现原理.md
================================================
# Sonic Quick模式实现原理
---
根据本地是否有缓存数据可以将Quick模式下的sonic分为无缓存和有缓存模式。对于有缓存模式又可以分为完全缓存、局部刷新和全局刷新(也就是模版变更),下面就看下这几种模式的执行流程。
无论是哪种执行模式,核心的思想都是并行,即充分利用webview初始化的时间进行一些数据的处理(webview的初始化耗时还是挺多的)。在包含webview的activity启动时会一边进行webview的初始化逻辑,一边并行的执行sonic的逻辑。
## 一,无缓存模式
无缓存模式下的核心思想就是在webview初始化之前建立自己的网络连接,利用webview初始化的时间尽可能多的读取网络的数据,在webview需要数据的时候将自己从网络读取的数据交给webview处理。
代码的主要执行流程
<img src = "sonicQuickModeFirst.png" width=100% height=100%>
这里主要有两条并行线,左边是webview的执行流程,右边是sonic的执行流程。Webview的执行流程比较简单,主要是进行webview的初始化,以及在初始化完之后调用SonicSession(这里的SonicSession对象是activity onCreate的时候通过SonicEngine创建的)的onClientReady方法,告知其webview已经init完毕。剩下的事情交给sonic那边处理。
右边这条sonic的执行流程线相对会复杂一些,首先,在activity create之后通过SonicEngine创建SonicSession对象。接着调用SonicCacheInterceptor来获取本地缓存的url对应的数据。由于是首次加载即本地无缓存数据,所以这里的数据是为空的。获取的数据为空之后会post一个CLIENT_CORE_MSG_PRE_LOAD(arg1 = PRE_LOAD_NO_CACHE )的消息到主线程中,同时继续执行下面的逻辑。主线程的逻辑后面统一分析,这里先分析sonic所在子线程中的逻辑。
Sonic在post消息到主线程之后会通过SonicSessionConnection建立一个URLConnection,接着通过这个连接获取服务器返回的数据。由于获取网络数据是个耗时的过程,所以在读取网络数据的过程中会不断的判断webView是否发起资源拦截请求(通过SonicSession的wasInterceptInvoked来判断),如果webview已经发起资源拦截请求,就中断网络数据的读取,将已经读取的数据和未读取的网络数据拼接成桥接流SonicSessionStream,并将其赋值给SonicSession的pendingWebResourceStream。如果整个网络数据读取完毕之后webview还没有初始化完,那么就会把之前post的CLIENT_CORE_MSG_PRE_LOAD的消息cancel调。同时post一个CLIENT_CORE_MSG_FIRST_LOAD的消息到主线程。之后再对html内容进行模版分割及数据保存。
接下来看看主线程的执行逻辑。之前说过sonic在本地无缓存的时候会先post一个CLIENT_CORE_MSG_PRE_LOAD的消息到主线程,如果主线程有执行到这个消息的话(之前也介绍过这个消息有可能被cancel掉)就会调用webview的loadUrl,发起真正的网络请求,之后webview会调用本身的资源拦截方法,在这个方法中sonic会将之前保存的pendingWebResourceStream返回给webview,有了这个pendingWebResourceStream之后webview就可以进行解析渲染逻辑了。同时webview在展示完页面之后会调SonicSessionStream的onClose方法进行关闭数据流,在这个onClose中我们会进行html内容的数据分割以及数据保存操作。
如果主线程处理的是CLIENT_CORE_MSG_FIRST_LOAD消息,则会先判断webview之前是否有发生过loadUrl(通过wasLoadUrlInvoked来判断),如果没有,调用webview的loadDataWithBaseUrl方法去加载之前读取的网络数据,这样webview就可以根据这个数据直接做解析渲染的逻辑了;如果有就不做任何的逻辑处理了。
以上就是在quick模式下sonic首次的基本逻辑。这里有个问题要注意,就是主线程在处理sonic post的消息之前都会判断webview是否ready(初始化完毕),只有webview ready的情况才会执行对应的操作。如果webview没有ready的话就会把对应的消息存起来,直到webview ready的时候再执行对应的逻辑。
## 二,有缓存模式
有缓存模式的核心思想也是在webview初始化之前先读取本地的数据,同时建立自己的网络连接,通过网络连接获取服务器最新的数据。在webview需要数据的时候将本地或服务器返回的新的数据交给webview处理。
有缓存模式又可以分为完全缓存、局部刷新、模板变更。下面依次介绍这几种模式。
###1,完全缓存:
所谓完全缓存就是本地的数据跟服务器的数据是完全一样的。
代码的主要执行流程:
<img src = "sonicQuickModeCache.png" width=100% height=100%>
左边webview的执行跟无缓存模式下没什么区别,右边sonic执行流程中前两步跟首次的逻辑一样,在完全缓存模式下通过SonicCacheInterceptor获取的url对应的本地数据是不为空的,这时候会post一个CLIENT_CORE_MSG_PRE_LOAD(arg1 = PRE_LOAD_WITH_CACHE)的消息到主线程中,同时服务器返回304,sonic流程就走完了。主线程在收到CLIENT_CORE_MSG_PRE_LOAD消息时通过loadDataWithBaseUrl加载本地数据给webview渲染。
###2,局部刷新:
局部刷新就是本地的数据跟服务器的数据相比,只有data部分有变化,模板跟服务器一样。
代码的主要执行流程:
<img src = "sonicQuickModeDataUpdate.png" width=100% height=100%>
左边webview的执行跟无缓存模式下没什么区别,右边sonic执行流程中前两步跟首次的逻辑一样,在局部刷新模式下通过SonicCacheInterceptor获取的url对应的本地数据是不为空的,这时候会post一个CLIENT_CORE_MSG_PRE_LOAD(arg1 = PRE_LOAD_WITH_CACHE)的消息到主线程中(主线程的执行逻辑后面再分析)。接着通过SonicSessionConnection获取服务器返回的数据,在这种模式下服务器返回的内容就是html的data部分。拿到data之后跟本地保存的data做diff,得到页面需要刷新的diffData。再post一个CLIENT_CORE_MSG_DATA_UPDATE的消息到主线程中,接着将服务器返回的data跟本地保存的模版进行合并,生成最新的html内容。之后将CLIENT_CORE_MSG_PRE_LOAD的消息移除(如果这个消息没有被执行的话)。最后将新合并的数据,以及服务器返回的data保存在本地。
下面看下主线程的执行逻辑。
之前说过在数据刷新模式下会post一个CLIENT_CORE_MSG_PRE_LOAD的消息到主线程,主线程如果有执行到这个消息(因为有可能被remove掉)的话就会调用webview的loadDataWithBaseUrl将本地的数据交给内核渲染,同时将本地变量wasLoadDataInvoked置为true。
当主线程接收到CLIENT_CORE_MSG_DATA_UPDATE的消息时会先判断wasLoadDataInvoked是否为true,即判断webview之前是否有掉过loadDataWithBaseUrl方法,如果有的话就会调用SonicSessionClient的callJacaScript方法将diffData给到页面,从而刷新页面如果wasLoadDataInvoked为false的话就调loadDataWithBaseUrl把最新的数据(服务器返回的数据跟本地模版合成的数据)给到webview去渲染。
### 3,模版变更
模板变更是本地的数据跟服务器数据相比,本地的模板跟服务器的模板不一样。
代码执行流程:
<img src = "sonicQuickModeTemplateChange.png" width=100% height=100%>
同样,左边webview的执行跟之前的模式相比也没什么区别。右边sonic流程的前面几步跟数据更新时候的逻辑是一样的。模版更新模式跟数据更新模式的不同点在于模版更新的时候服务器返回的是完整的html数据内容,sonic这边会先把html的内容读到内存中。由于读取网络数据耗时比较长,为了可以让页面更快的刷新,在读取网络数据的时候会不断判断之前load的本地缓存的数据的页面有没有finish(通过SonicSession的wasOnPageFinishInvoked来判断,这个值会在SonicSessionClient在webview onpagefinish的时候设置),如果wasOnPageFinishInvoked为true就不再读取网络数据了,而是将已读的数据和未读的数据组成桥接流SonicSessionStream,接着post CLIENT_CORE_MSG_TEMPLATE_CHANGE(msg.obj == null)的消息到主线程;如果整个网络数据读完wasOnPageFinishInvoked还是为false的话,就将已读的网络数据拼接成输入流。然后将CLIENT_CORE_MSG_PRE_LOAD的消息移除(如果这个消息没有被执行的话),post CLIENT_CORE_MSG_TEMPLATE_CHANGE(msg.obj == new html)的消息到主线程中,最后进行模版的分割以及数据的保存等操作。
跟前面一样,接下来分析下主线程的执行逻辑。
主线程执行逻辑比较简单,如果是CLIENT_CORE_MSG_PRE_LOAD消息的话就通过loadDataWithBaseUrl加载本地的数据,如果是CLIENT_CORE_MSG_TEMPLATE_CHANGE消息先判断msg.obj是否为空,如果为空发起loadUrl重新加载数据,同时在资源拦截的时候将本地建立的桥接流交给内核渲染。等待内核渲染完毕之后进行模版分割和模版拆分等操作。如果不为空就通过loadDataWithBaseUrl加载最新的数据。
这里解释下为什么在模版更新的时候需要判读之前load的本地页面是否有pagefinish。假设本地的页面已经展示完了,而sonic这边还在读取网络的数据,如果没有这个逻辑的话就会等sonic这边读完网络数据之后才能刷新页面;而有了这个逻辑之后就可以在pageFinish的时候直接发起loadUrl,利用webview边下载边解析的功能减少内核的等待时间,从而减少整个页面刷新的耗时。
以上就是sonic在Quick模式下的的大概流程
================================================
FILE: sonic-android/docs/Sonic Standard模式实现原理.md
================================================
# Sonic Standard模式实现原理
---
从前面介绍的sonic的基本原理可以知道,sonic分为Quick模式和Standard模式。本文介绍Standard模式的基本实现原理。
根据本地缓存的数据情况可以将Quick模式下的sonic分为无缓存和有缓存模式。对于有缓存模式又可以分为完全缓存、局部刷新和全局刷新(也就是模版变更),下面就看下这几种模式的执行流程。
无论是哪种执行模式,核心的思想都是并行,即充分利用webview初始化的时间进行一些数据的处理(webview的初始化耗时还是挺多的)。在包含webview的activity启动时会一边进行webview的初始化逻辑,一边并行的执行sonic的逻辑。
## 一,无缓存模式
无缓存模式下的核心思想就是在webview初始化之前建立自己的网络连接,利用webview初始化的时间尽可能多的读取网络的数据,在webview需要数据的时候将自己从网络读取的数据交给webview处理。
代码执行流程为:
<img src = "sonicStandardModeFirst.png" width=100% height=100%>
这里主要有两条并行线,左边是webview的执行流程,右边是sonic的执行流程。Webview的执行流程比较简单,主要是进行webview的初始话,以及在初始化完之后调用SonicSession(这里的SonicSession对象是activity onCreate的时候通过SonicEngine创建的)的onClientReady方法,告知其webview已经init完毕,之后就开始调webview的laodUrl方法,等待webview资源拦截的回调。剩下的事情交给sonic那边处理。
右边表示sonic的执行流程。首先调用SonicEngine.createSession创建SonicSession对象,接着调用SonicCacheIterceptor的getSonicCache方法来获取要加载的url对应的本地数据,由于是首次加载,所以这里的cache数据是为空的。之后会通过SonicSessionConnection建立一个URLConnection,接着通过这个连接获取服务器返回的数据。由于获取网络数据是个耗时的过程,所以在读取网络数据的过程中会不断判断webView是否发起资源拦截请求(通过SonicSession的wasInterceptInvoked来判断),如果webview已经发起资源拦截请求,就中断网络数据的读取,将已经读取的数据和未读取的网络数据拼接成桥接流SonicSessionStream,并将其赋值给SonicSession的pendingWebResourceStream。
因此在webview发起资源拦截时pendingWebResourceStream存在两种可能,一种时网络数据还没完全读完的桥接流,另一种是网络数据已经完全读完的数据流。如果是桥接流的话在webview渲染完成关闭桥接流的时候会进行模版分割,数据保存等操作。如果是已读完的数据流的话就会在将pendingWebResourceStream数据给内核之后继续在子线程中执行模版分割,数据保存等操作。
## 二,有缓存模式:
有缓存模式的核心思想也是在webview初始化之前先读取本地的数据,同时建立自己的网络连接,通过网络连接获取服务器最新的数据。在webview需要数据的时候将本地或服务器返回的新的数据交给webview处理。
有缓存模式又可以分为完全缓存、局部刷新、模板变更。下面依次介绍这几种模式。
### 1,完全缓存:
所谓完全缓存就是本地的数据跟服务器的数据是完全一样的。
代码执行流程为
<img src = "sonicStandardModeCache.png" width=100% height=100%>
左边webview的执行逻辑跟首次基本一致。右边sonic的执行逻辑前面几步跟首次的逻辑也基本一致,不同的地方开始于通过SonicCacheInterceptor获取的本地cacahe数据是不为空的,会将本地的数据包装为一个InputStream,在webview发起资源拦截的时候将这个InputStream交给内核渲染。同时通过SonicSessionConnection向服务器请求最新数据,由于服务器返回304,没有数据更新,整个sonic的流程执行完毕。
### 2,局部刷新:
局部刷新就是本地的数据跟服务器的数据相比,只有data部分有变化,模板跟服务器一样。
代码执行流程为:
<img src = "sonicStandardModeDataUpdate.png" width=100% height=100%>
左边webview的流程跟前面介绍的基本一样,不一样的地方后面会讲。右边sonic的逻辑前面几步跟完全缓存的时候一样,会先讲本地的数据包装成一个InputStream赋值给SonicSession 的pendingWebResourceStream,接着通过SonicSessionConnection获取服务器的回包数据。这种模式下服务器的回包数据是html的data部分的内容。将这个data跟本地的data做diff,就会得到页面刷新需要的diffData,有了这个diffData之后会将它保存在SonicSession的pendingDiffData变量中。接着通过SonicUtils的buildHtml将服务器返回的data跟本地的模版数据拼接成新的html内容。有了新的html内容之后判断webview的资源拦截是否有发起(通过SonicSession的wasInterceptInvoked来判断),如果有发起的话就将新的html内容保存在本地,然后流程执行完毕。如果这是webview还没有发起资源拦截的话就会将pendingDiffData置空,同时将新的html包装成一个InputStream赋值给pendingWebResourceStream,然后执行最后的数据保存等操作。
通过上面的介绍可以知道在数据更新模式下,webview发起资源拦截的时候有可能得到两种值,一种是之前本地数据组成的输入流,在这种情况下页面调用js获取diffData的时候会将保存的diffData给到页面,让页面执行刷新操作;另一种是由服务器返回的data跟本地模版组成的最新的html包装成的输入流,这种情况下页面展示的就是最新的数据,在获取diffData的时候就不会有返回值了。
### 3,模版变更
模板变更是本地的数据跟服务器数据相比,本地的模板跟服务器的模板不一样。
代码执行流程为:
<img src = "sonicStandardModeTemplateChange.png" width=100% height=100%>
左边webview的逻辑跟首次差不多,不一样的地方后面再讲。右边sonic的逻辑前面几个跟数据更新基本一致,不一样的地方开始于服务器的回包数据不同。在模版更新模式下服务器会返回最新的完整的html内容,由于读取网络数据耗时比较长,为了可以让页面更快的刷新,在读取网络数据的时候会不断判断之前load的本地缓存的数据的页面有没有finish(通过SonicSession的wasOnPageFinishInvoked来判断,这个值会在SonicSessionClient在webview onpagefinish的时候设置),如果wasOnPageFinishInvoked为true就不再读取网络数据了,而是将已读的数据和未读的数据组成桥接流SonicSessionStream,然后在主线程中发起loadUrl。同时在webview资源拦截的时候将刚才建立的桥接流交给内核渲染。
如果整个网络数据读取过程wasOnPageFinishInvoked都没有被设置为true的话sonic就会将读取完的最新的数据包装成一个输入流放在pendingWebResourceStream里。接下来判断wevbiew是否有发起资源拦截。如果没有的话就执行最后的保存数据操作,因为这时已经将pendingWebResourceStream更新为最新的数据了,当webview发起资源拦截的时候sonic给到内核的就是最新的数据了;如果此时webview的资源拦截已经发起了,就是说webview已经加载过之前本地的数据了,那么这时候sonic会主动再调一次webview的loadUrl方法进行刷新页面,等到webview第二次发起资源拦截请求的时候再把最新的数据给到内核去渲染,这种情况sonic在发起webview的loadUrl之后就会继续在子线程执行文件保存等收尾的工作。
这里解释下为什么在模版更新的时候需要判读之前load的本地页面是否有pagefinish。假设本地的页面已经展示完了,而sonic这边还在读取网络的数据,如果没有这个逻辑的话就会等sonic这边读完网络数据之后才能刷新页面;而有了这个逻辑之后就可以在pageFinish的时候直接发起loadUrl,利用webview边下载边解析的功能减少内核的等待时间,从而减少整个页面刷新的耗时。
以上就是sonic在Standard模式下的的大概流程
================================================
FILE: sonic-android/docs/Sonic接入指引.md
================================================
# 终端接入指引-Android版本
----
## 1.Sdk引入配置
在模块的build.gradle文件里面加入
```
compile 'com.tencent.sonic:sdk:3.0.0-alpha'
```
## 2.代码接入
### (1).创建一个类继承SonicRuntime
SonicRuntime类主要提供sonic运行时环境,包括Context、用户UA、ID(用户唯一标识,存放数据时唯一标识对应用户)等等信息。以下代码展示了SonicRuntime的几个方法。
```java
public class HostSonicRuntime extends SonicRuntime {
public HostSonicRuntime(Context context) {
super(context);
}
/**
* 获取用户UA信息
* @return
*/
@Override
public String getUserAgent() {
return "";
}
/**
* 获取用户ID信息
* @return
*/
@Override
public String getCurrentUserAccount() {
return "";
}
/**
* 创建sonic文件存放的路径
* @return
*/
@Override
public File getSonicCacheDir() {
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "sonic/";
File file = new File(path.trim());
if(!file.exists()){
file.mkdir();
}
return file;
}
}
```
### (2).创建一个类继承SonicSessionClient
SonicSessionClient主要负责跟webView的通信,比如调用webView的loadUrl、loadDataWithBaseUrl等方法。
```java
public class SonicSessionClientImpl extends SonicSessionClient {
private WebView webView;
public void bindWebView(WebView webView) {
this.webView = webView;
}
/**
* 调用webView的loadUrl
*/
@Override
public void loadUrl(String url, Bundle extraData) {
webView.loadUrl(url);
}
/**
* 调用webView的loadDataWithBaseUrl方法
*/
@Override
public void loadDataWithBaseUrl(String baseUrl, String data, String mimeType, String encoding,
String historyUrl) {
webView.loadDataWithBaseURL(baseUrl, data, mimeType, encoding, historyUrl);
}
}
```
### (3).新建包含webView的Activity(或者Fragment等),在activity中完成sonic的接入。这里通过简单的demo展示如何接入
```java
public class SonicTestActivity extends Activity {
public final static String PARAM_URL = "param_url";
public final static String PARAM_MODE = "param_mode";
private SonicSession sonicSession;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
String url = intent.getStringExtra(PARAM_URL);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
// init sonic engine if necessary, or maybe u can do this when application created
if (!SonicEngine.isGetInstanceAllowed()) {
SonicEngine.createInstance(new SonicRuntimeImpl(getApplication()), new SonicConfig.Builder().build());
}
SonicSessionClientImpl sonicSessionClient = null;
// if it's sonic mode , startup sonic session at first time
SonicSessionConfig.Builder sessionConfigBuilder = new SonicSessionConfig.Builder();
// create sonic session and run sonic flow
sonicSession = SonicEngine.getInstance().createSession(url, sessionConfigBuilder.build());
if (null != sonicSession) {
sonicSession.bindClient(sonicSessionClient = new SonicSessionClientImpl());
} else {
// this only happen when a same sonic session is already running,
// u can comment following code to feedback for default mode to
throw new UnknownError("create session fail!");
}
// start init flow ... in the real world, the init flow may cost a long time as startup
// runtime、init configs....
setContentView(R.layout.activity_browser);
// init webview
WebView webView = (WebView) findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if (sonicSession != null) {
sonicSession.getSessionClient().pageFinish(url);
}
}
@TargetApi(21)
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
return shouldInterceptRequest(view, request.getUrl().toString());
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
if (sonicSession != null) {
return (WebResourceResponse) sonicSession.getSessionClient().requestResource(url);
}
return null;
}
});
WebSettings webSettings = webView.getSettings();
// add java script interface
// note:if api level if lower than 17(android 4.2), addJavascriptInterface has security
// issue, please use x5 or see https://developer.android.com/reference/android/webkit/
// WebView.html#addJavascriptInterface(java.lang.Object, java.lang.String)
webSettings.setJavaScriptEnabled(true);
webView.removeJavascriptInterface("searchBoxJavaBridge_");
intent.putExtra(SonicJavaScriptInterface.PARAM_LOAD_URL_TIME, System.currentTimeMillis());
webView.addJavascriptInterface(new SonicJavaScriptInterface(sonicSessionClient, intent), "sonic");
// init webview settings
webSettings.setAllowContentAccess(true);
webSettings.setDatabaseEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setAppCacheEnabled(true);
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
// webview is ready now, just tell session client to bind
if (sonicSessionClient != null) {
sonicSessionClient.bindWebView(webView);
sonicSessionClient.clientReady();
} else { // default mode
webView.loadUrl(url);
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
@Override
protected void onDestroy() {
if (null != sonicSession) {
sonicSession.destroy();
sonicSession = null;
}
super.onDestroy();
}
}
```
SonicTestActivity是一个含有webView的demo代码,里面展示了sonic的整体流程。主要分为6个步骤:
**Step1**:在activity onCreate的时候创建SonicRuntime并且初始化SonicEngine。为sonic初始化运行时需要的环境
```java
if (!SonicEngine.isGetInstanceAllowed()) {
SonicEngine.createInstance(new SonicRuntimeImpl(getApplication()), new SonicConfig.Builder().build());
}
```
**Setp2**:通过SonicEngine.getInstance().createSession来为要加载的url创建一个SonicSession对象,同时为session绑定client。session创建之后sonic就会异步加载数据了。
```java
SonicSessionConfig.Builder sessionConfigBuilder = new SonicSessionConfig.Builder();
// create sonic session and run sonic flow
sonicSession = SonicEngine.getInstance().createSession(url, sessionConfigBuilder.build());
if (null != sonicSession) {
sonicSession.bindClient(sonicSessionClient = new SonicSessionClientImpl());
}
```
**Step3**:设置javascript,这个主要是设置页面跟终端的js交互方式。
按照sonic的规范,webView打开页面之后页面会通过js来获取sonic提供的一些数据(比如页面需要刷新的数据)。Demo里使用的是标准的js交互代码,第三方可以替换为自己的js交互实现方式(比如提供jsbridge伪协议等)。
```java
webSettings.setJavaScriptEnabled(true);
webView.removeJavascriptInterface("searchBoxJavaBridge_");
webView.addJavascriptInterface(new SonicJavaScriptInterface(sonicSessionClient, intent), "sonic");
```
**Step4**:为clinet绑定webview,在webView准备发起loadUrl的时候通过SonicSession的onClientReady方法通知sonicSession: webView ready可以开始loadUrl了。这时sonic内部就会根据本地的数据情况执行webView相应的逻辑(执行loadUrl或者loadData等)。
```java
if (sonicSessionClient != null) {
sonicSessionClient.bindWebView(webView);
sonicSessionClient.clientReady();
}
```
**Step5**:在webView资源拦截的回调中调用session.onClientRequestResource(url)。通过这个方法向sonic获取url对应的WebResourceResponse数据。这样内核就可以根据这个返回的response的内容进行渲染了。(如果sonic在webView ready的时候执行的是loadData的话,是不会走到资源拦截这里的)
```java
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
if (sonicSession != null) {
return (WebResourceResponse) sonicSession.getSessionClient().requestResource(url);
}
return null;
}
```
================================================
FILE: sonic-android/docs/Sonic框架介绍.md
================================================
# Sonic框架介绍
---
本文主要介绍sonic的整个框架设置,包括这个框架的类图结构以及各个类的主要职责介绍。
sonicSdk类图结构:
<img src = "sonic.png">
sonic类职责说明:
SonicSession:负责sonic的核心逻辑:包括缓存数据的获取,服务器回包数据的处理,页面展示数据的生成以及数据模版的拆分、拼接等。
QuickSonicSession:SonicSession的子类,这种类型的session会使用webview的loadData方式来加载页面。这种方式加载速度比较快,但是由于不能带header(例如csp等),可能会有一些安全问题。
StandardSonicSession:SonicSession的子类,这种类型的session只是通过loadUrl,并且在资源拦截的时候返回数据。这种类型相比于QuickSonicSession速度上可能会慢一些(因为资源拦截需要内核底层派发,再到终端进行拦截)。但是这种方式支持在数据返回的时候添加header,所以不存在安全问题。
SonicEngine:sonic引擎初始化,主要初始化sonic运行需要的runtime和context等信息。
SonicRuntime:提供sonic运行环境需要的一些数据,比如context,文件的保存路径,页面的cookie等信息。
SonicSessionClient:提供sonic与webview交互需要的功能,例如loadUrl,loadDataWithBaseUrl等
SonicCacheInterceptor:sonic缓存数据的提供者,第三方可以提供自定义的缓存内容,也可以使用sonic默认提供的缓存数据。
SonicSessionConnection:sonic底层连接的提供者,通过SonicSessionConnection去获取服务器的回包数据。
SonicSessionStream:为sonic提供数据流,SonicSessionStream会将已读取的网络数据和未读取的网络数据组合成一个桥接流,将这个桥接的数据提供给webview内核进行渲染。利用webview流式加载功能减少耗时。
SonicUtils:sonic工具类,主要负责sonic数据的模版分割,数据重组,diffdata计算等
SonicFileUtils:sonic文件操作工具类,主要负责文件的读写
SonicDataHelper:sonic数据帮助类,主要负责管理sonic除去文件内容之外的其它数据,比如html的md5值,模版的tag等等。
================================================
FILE: sonic-android/docs/javadoc/allclasses-frame.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:58 CST 2018 -->
<title>所有类 (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">所有类</h1>
<div class="indexContainer">
<ul>
<li><a href="com/tencent/sonic/sdk/QuickSonicSession.html" title="com.tencent.sonic.sdk中的类" target="classFrame">QuickSonicSession</a></li>
<li><a href="com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicCacheInterceptor</a></li>
<li><a href="com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicConfig</a></li>
<li><a href="com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicConfig.Builder</a></li>
<li><a href="com/tencent/sonic/sdk/SonicConstants.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicConstants</a></li>
<li><a href="com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicDBHelper</a></li>
<li><a href="com/tencent/sonic/sdk/SonicDiffDataCallback.html" title="com.tencent.sonic.sdk中的接口" target="classFrame"><span class="interfaceName">SonicDiffDataCallback</span></a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCache.html" title="com.tencent.sonic.sdk.download中的类" target="classFrame">SonicDownloadCache</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCache.SonicResourceCache.html" title="com.tencent.sonic.sdk.download中的类" target="classFrame">SonicDownloadCache.SonicResourceCache</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCallback.html" title="com.tencent.sonic.sdk.download中的接口" target="classFrame"><span class="interfaceName">SonicDownloadCallback</span></a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCallback.SimpleDownloadCallback.html" title="com.tencent.sonic.sdk.download中的类" target="classFrame">SonicDownloadCallback.SimpleDownloadCallback</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadClient.html" title="com.tencent.sonic.sdk.download中的类" target="classFrame">SonicDownloadClient</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadClient.DownloadTask.html" title="com.tencent.sonic.sdk.download中的类" target="classFrame">SonicDownloadClient.DownloadTask</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadClient.SubResourceDownloadCallback.html" title="com.tencent.sonic.sdk.download中的类" target="classFrame">SonicDownloadClient.SubResourceDownloadCallback</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadEngine.html" title="com.tencent.sonic.sdk.download中的类" target="classFrame">SonicDownloadEngine</a></li>
<li><a href="com/tencent/sonic/sdk/SonicEngine.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicEngine</a></li>
<li><a href="com/tencent/sonic/sdk/SonicFileUtils.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicFileUtils</a></li>
<li><a href="com/tencent/sonic/sdk/SonicResourceDataHelper.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicResourceDataHelper</a></li>
<li><a href="com/tencent/sonic/sdk/SonicResourceDataHelper.ResourceData.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicResourceDataHelper.ResourceData</a></li>
<li><a href="com/tencent/sonic/sdk/SonicRuntime.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicRuntime</a></li>
<li><a href="com/tencent/sonic/sdk/SonicServer.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicServer</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSession</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSession.Callback.html" title="com.tencent.sonic.sdk中的接口" target="classFrame"><span class="interfaceName">SonicSession.Callback</span></a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionClient.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionClient</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConfig.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionConfig</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConfig.Builder.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionConfig.Builder</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConnection.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionConnection</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConnection.SessionConnectionDefaultImpl.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionConnection.SessionConnectionDefaultImpl</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConnectionInterceptor.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionConnectionInterceptor</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionStatistics.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionStatistics</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionStream.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicSessionStream</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionStream.Callback.html" title="com.tencent.sonic.sdk中的接口" target="classFrame"><span class="interfaceName">SonicSessionStream.Callback</span></a></li>
<li><a href="com/tencent/sonic/sdk/SonicUtils.html" title="com.tencent.sonic.sdk中的类" target="classFrame">SonicUtils</a></li>
<li><a href="com/tencent/sonic/sdk/StandardSonicSession.html" title="com.tencent.sonic.sdk中的类" target="classFrame">StandardSonicSession</a></li>
</ul>
</div>
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/allclasses-noframe.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:58 CST 2018 -->
<title>所有类 (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">所有类</h1>
<div class="indexContainer">
<ul>
<li><a href="com/tencent/sonic/sdk/QuickSonicSession.html" title="com.tencent.sonic.sdk中的类">QuickSonicSession</a></li>
<li><a href="com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类">SonicCacheInterceptor</a></li>
<li><a href="com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类">SonicConfig</a></li>
<li><a href="com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></li>
<li><a href="com/tencent/sonic/sdk/SonicConstants.html" title="com.tencent.sonic.sdk中的类">SonicConstants</a></li>
<li><a href="com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类">SonicDBHelper</a></li>
<li><a href="com/tencent/sonic/sdk/SonicDiffDataCallback.html" title="com.tencent.sonic.sdk中的接口"><span class="interfaceName">SonicDiffDataCallback</span></a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCache.html" title="com.tencent.sonic.sdk.download中的类">SonicDownloadCache</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCache.SonicResourceCache.html" title="com.tencent.sonic.sdk.download中的类">SonicDownloadCache.SonicResourceCache</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCallback.html" title="com.tencent.sonic.sdk.download中的接口"><span class="interfaceName">SonicDownloadCallback</span></a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadCallback.SimpleDownloadCallback.html" title="com.tencent.sonic.sdk.download中的类">SonicDownloadCallback.SimpleDownloadCallback</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadClient.html" title="com.tencent.sonic.sdk.download中的类">SonicDownloadClient</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadClient.DownloadTask.html" title="com.tencent.sonic.sdk.download中的类">SonicDownloadClient.DownloadTask</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadClient.SubResourceDownloadCallback.html" title="com.tencent.sonic.sdk.download中的类">SonicDownloadClient.SubResourceDownloadCallback</a></li>
<li><a href="com/tencent/sonic/sdk/download/SonicDownloadEngine.html" title="com.tencent.sonic.sdk.download中的类">SonicDownloadEngine</a></li>
<li><a href="com/tencent/sonic/sdk/SonicEngine.html" title="com.tencent.sonic.sdk中的类">SonicEngine</a></li>
<li><a href="com/tencent/sonic/sdk/SonicFileUtils.html" title="com.tencent.sonic.sdk中的类">SonicFileUtils</a></li>
<li><a href="com/tencent/sonic/sdk/SonicResourceDataHelper.html" title="com.tencent.sonic.sdk中的类">SonicResourceDataHelper</a></li>
<li><a href="com/tencent/sonic/sdk/SonicResourceDataHelper.ResourceData.html" title="com.tencent.sonic.sdk中的类">SonicResourceDataHelper.ResourceData</a></li>
<li><a href="com/tencent/sonic/sdk/SonicRuntime.html" title="com.tencent.sonic.sdk中的类">SonicRuntime</a></li>
<li><a href="com/tencent/sonic/sdk/SonicServer.html" title="com.tencent.sonic.sdk中的类">SonicServer</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSession.Callback.html" title="com.tencent.sonic.sdk中的接口"><span class="interfaceName">SonicSession.Callback</span></a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionClient.html" title="com.tencent.sonic.sdk中的类">SonicSessionClient</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConfig.html" title="com.tencent.sonic.sdk中的类">SonicSessionConfig</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicSessionConfig.Builder</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConnection.html" title="com.tencent.sonic.sdk中的类">SonicSessionConnection</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConnection.SessionConnectionDefaultImpl.html" title="com.tencent.sonic.sdk中的类">SonicSessionConnection.SessionConnectionDefaultImpl</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionConnectionInterceptor.html" title="com.tencent.sonic.sdk中的类">SonicSessionConnectionInterceptor</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionStatistics.html" title="com.tencent.sonic.sdk中的类">SonicSessionStatistics</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionStream.html" title="com.tencent.sonic.sdk中的类">SonicSessionStream</a></li>
<li><a href="com/tencent/sonic/sdk/SonicSessionStream.Callback.html" title="com.tencent.sonic.sdk中的接口"><span class="interfaceName">SonicSessionStream.Callback</span></a></li>
<li><a href="com/tencent/sonic/sdk/SonicUtils.html" title="com.tencent.sonic.sdk中的类">SonicUtils</a></li>
<li><a href="com/tencent/sonic/sdk/StandardSonicSession.html" title="com.tencent.sonic.sdk中的类">StandardSonicSession</a></li>
</ul>
</div>
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/com/tencent/sonic/sdk/QuickSonicSession.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:57 CST 2018 -->
<title>QuickSonicSession (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="QuickSonicSession (sdk 3.0.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
var tabs = {65535:["t0","所有方法"],2:["t2","实例方法"],8:["t4","具体方法"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个类</li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/QuickSonicSession.html" target="_top">框架</a></li>
<li><a href="QuickSonicSession.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li><a href="#nested.classes.inherited.from.class.com.tencent.sonic.sdk.SonicSession">嵌套</a> | </li>
<li><a href="#fields.inherited.from.class.com.tencent.sonic.sdk.SonicSession">字段</a> | </li>
<li>构造器 | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.tencent.sonic.sdk</div>
<h2 title="类 QuickSonicSession" class="title">类 QuickSonicSession</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">com.tencent.sonic.sdk.SonicSession</a></li>
<li>
<ul class="inheritance">
<li>com.tencent.sonic.sdk.QuickSonicSession</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>所有已实现的接口:</dt>
<dd>android.os.Handler.Callback</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">QuickSonicSession</span>
extends <a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a>
implements android.os.Handler.Callback</pre>
<div class="block">A subclass of SonicSession.
QuickSonicSession mainly uses <a href="../../../../com/tencent/sonic/sdk/SonicSessionClient.html#loadDataWithBaseUrlAndHeader-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.util.HashMap-"><code>SonicSessionClient.loadDataWithBaseUrlAndHeader(String, String, String, String, String, HashMap)</code></a>
to load data. Sometime, it will use <a href="../../../../com/tencent/sonic/sdk/SonicSessionClient.html#loadUrl-java.lang.String-android.os.Bundle-"><code>SonicSessionClient.loadUrl(String, Bundle)</code></a> instead. By using
<a href="../../../../com/tencent/sonic/sdk/SonicSessionClient.html#loadDataWithBaseUrlAndHeader-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.util.HashMap-"><code>SonicSessionClient.loadDataWithBaseUrlAndHeader(String, String, String, String, String, HashMap)</code></a>, WebView will
quickly load web pages without the network affecting.
<p>
ATTENTION:
Standard WebView don't have head information (such as csp) when it calls
<a href="../../../../com/tencent/sonic/sdk/SonicSessionClient.html#loadDataWithBaseUrlAndHeader-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.util.HashMap-"><code>SonicSessionClient.loadDataWithBaseUrlAndHeader(String, String, String, String, String, HashMap)</code></a> method.
So this session mode may cause a security risk. However, you can put the csp contents into the html to avoid this risk caused by the lack of csp.
<p>
See also <a href="../../../../com/tencent/sonic/sdk/StandardSonicSession.html" title="com.tencent.sonic.sdk中的类"><code>StandardSonicSession</code></a></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>嵌套类概要</h3>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.com.tencent.sonic.sdk.SonicSession">
<!-- -->
</a>
<h3>从类继承的嵌套类/接口 com.tencent.sonic.sdk.<a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></h3>
<code><a href="../../../../com/tencent/sonic/sdk/SonicSession.Callback.html" title="com.tencent.sonic.sdk中的接口">SonicSession.Callback</a></code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>字段概要</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.com.tencent.sonic.sdk.SonicSession">
<!-- -->
</a>
<h3>从类继承的字段 com.tencent.sonic.sdk.<a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></h3>
<code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#CHROME_FILE_THREAD">CHROME_FILE_THREAD</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#CLIENT_MSG_NOTIFY_RESULT">CLIENT_MSG_NOTIFY_RESULT</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#CLIENT_MSG_ON_WEB_READY">CLIENT_MSG_ON_WEB_READY</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#clientIsReady">clientIsReady</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#clientIsReload">clientIsReload</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#COMMON_MSG_BEGIN">COMMON_MSG_BEGIN</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#COMMON_MSG_END">COMMON_MSG_END</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#config">config</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#createdTime">createdTime</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#DATA_UPDATE_BUNDLE_PARAMS_DIFF">DATA_UPDATE_BUNDLE_PARAMS_DIFF</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#diffDataCallback">diffDataCallback</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#FILE_THREAD_MSG_BEGIN">FILE_THREAD_MSG_BEGIN</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#FILE_THREAD_SAVE_CACHE_ON_SERVER_CLOSE">FILE_THREAD_SAVE_CACHE_ON_SERVER_CLOSE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#FILE_THREAD_SAVE_CACHE_ON_SESSION_FINISHED">FILE_THREAD_SAVE_CACHE_ON_SESSION_FINISHED</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#fileHandler">fileHandler</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#finalResultCode">finalResultCode</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#id">id</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#intent">intent</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#isPreload">isPreload</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#isWaitingForDestroy">isWaitingForDestroy</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#isWaitingForSaveFile">isWaitingForSaveFile</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#isWaitingForSessionThread">isWaitingForSessionThread</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#mainHandler">mainHandler</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#OFFLINE_MODE_FALSE">OFFLINE_MODE_FALSE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#OFFLINE_MODE_HTTP">OFFLINE_MODE_HTTP</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#OFFLINE_MODE_STORE">OFFLINE_MODE_STORE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#OFFLINE_MODE_TRUE">OFFLINE_MODE_TRUE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#pendingDiffData">pendingDiffData</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#pendingWebResourceStream">pendingWebResourceStream</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#preloadLinks">preloadLinks</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#RESOURCE_INTERCEPT_STATE_IN_FILE_THREAD">RESOURCE_INTERCEPT_STATE_IN_FILE_THREAD</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#RESOURCE_INTERCEPT_STATE_IN_OTHER_THREAD">RESOURCE_INTERCEPT_STATE_IN_OTHER_THREAD</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#RESOURCE_INTERCEPT_STATE_NONE">RESOURCE_INTERCEPT_STATE_NONE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#resourceDownloaderEngine">resourceDownloaderEngine</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#resourceInterceptState">resourceInterceptState</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#server">server</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#SESSION_MSG_FORCE_DESTROY">SESSION_MSG_FORCE_DESTROY</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#sessionCallbackList">sessionCallbackList</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#sessionClient">sessionClient</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#sessionState">sessionState</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#sId">sId</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#sNextSessionLogId">sNextSessionLogId</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#SONIC_RESULT_CODE_DATA_UPDATE">SONIC_RESULT_CODE_DATA_UPDATE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#SONIC_RESULT_CODE_FIRST_LOAD">SONIC_RESULT_CODE_FIRST_LOAD</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#SONIC_RESULT_CODE_HIT_CACHE">SONIC_RESULT_CODE_HIT_CACHE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#SONIC_RESULT_CODE_TEMPLATE_CHANGE">SONIC_RESULT_CODE_TEMPLATE_CHANGE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#SONIC_RESULT_CODE_UNKNOWN">SONIC_RESULT_CODE_UNKNOWN</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#srcResultCode">srcResultCode</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#srcUrl">srcUrl</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#STATE_DESTROY">STATE_DESTROY</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#STATE_NONE">STATE_NONE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#STATE_READY">STATE_READY</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#STATE_RUNNING">STATE_RUNNING</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#stateChangedCallbackList">stateChangedCallbackList</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#statistics">statistics</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#wasInterceptInvoked">wasInterceptInvoked</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#wasOnPageFinishInvoked">wasOnPageFinishInvoked</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#WEB_RESPONSE_CODE">WEB_RESPONSE_CODE</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#WEB_RESPONSE_DATA">WEB_RESPONSE_DATA</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#WEB_RESPONSE_EXTRA">WEB_RESPONSE_EXTRA</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#WEB_RESPONSE_LOCAL_REFRESH_TIME">WEB_RESPONSE_LOCAL_REFRESH_TIME</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#WEB_RESPONSE_SRC_CODE">WEB_RESPONSE_SRC_CODE</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>方法概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="方法概要表, 列表方法和解释">
<caption><span id="t0" class="activeTableTab"><span>所有方法</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">实例方法</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">具体方法</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">方法和说明</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#clearSessionData--">clearSessionData</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#handleFlow_DataUpdate-java.lang.String-">handleFlow_DataUpdate</a></span>(java.lang.String serverRsp)</code>
<div class="block">In this case sonic obtains the difference data between the server and the local
data first,then sonic will build the template and server data into html,
then send a <code>CLIENT_CORE_MSG_DATA_UPDATE</code> message.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#handleFlow_FirstLoad--">handleFlow_FirstLoad</a></span>()</code>
<div class="block">In this case sonic will always read the new data from the server until the client
initiates a resource interception.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#handleFlow_HttpError-int-">handleFlow_HttpError</a></span>(int responseCode)</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#handleFlow_LoadLocalCache-java.lang.String-">handleFlow_LoadLocalCache</a></span>(java.lang.String cacheHtml)</code>
<div class="block">Handle load local cache of html if exist.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#handleFlow_ServiceUnavailable--">handleFlow_ServiceUnavailable</a></span>()</code> </td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#handleFlow_TemplateChange-java.lang.String-">handleFlow_TemplateChange</a></span>(java.lang.String newHtml)</code>
<div class="block">In this case sonic will always read the new data from the server until the local page finish.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#handleMessage-android.os.Message-">handleMessage</a></span>(android.os.Message msg)</code>
<div class="block">Subclasses must implement this to receive messages.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#onClientReady--">onClientReady</a></span>()</code>
<div class="block">Client informs sonic that it is ready.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>protected java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#onRequestResource-java.lang.String-">onRequestResource</a></span>(java.lang.String url)</code>
<div class="block">When the webview initiates a main resource interception, the client invokes this method to retrieve the data</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html#onWebReady-com.tencent.sonic.sdk.SonicDiffDataCallback-">onWebReady</a></span>(<a href="../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html" title="com.tencent.sonic.sdk中的接口">SonicDiffDataCallback</a> callback)</code>
<div class="block">Client will call this method to obtain the update data when the page shows the content.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.tencent.sonic.sdk.SonicSession">
<!-- -->
</a>
<h3>从类继承的方法 com.tencent.sonic.sdk.<a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></h3>
<code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#addSessionCallback-com.tencent.sonic.sdk.SonicSessionCallback-">addSessionCallback</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#addSessionStateChangedCallback-com.tencent.sonic.sdk.SonicSession.Callback-">addSessionStateChangedCallback</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#bindClient-com.tencent.sonic.sdk.SonicSessionClient-">bindClient</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#canDestroy--">canDestroy</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#createConnectionIntent-com.tencent.sonic.sdk.SonicDataHelper.SessionData-">createConnectionIntent</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#destroy--">destroy</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#destroy-boolean-">destroy</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#doSaveSonicCache-com.tencent.sonic.sdk.SonicServer-java.lang.String-">doSaveSonicCache</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getCacheHeaders--">getCacheHeaders</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getCharsetFromHeaders--">getCharsetFromHeaders</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getCharsetFromHeaders-java.util.Map-">getCharsetFromHeaders</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getCurrentUrl--">getCurrentUrl</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getFinalResultCode--">getFinalResultCode</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getHeaders--">getHeaders</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getSessionClient--">getSessionClient</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getSrcResultCode--">getSrcResultCode</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#getStatistics--">getStatistics</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_Connection-boolean-com.tencent.sonic.sdk.SonicDataHelper.SessionData-">handleFlow_Connection</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_NotModified--">handleFlow_NotModified</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#isDestroyedOrWaitingForDestroy--">isDestroyedOrWaitingForDestroy</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#isMatchCurrentUrl-java.lang.String-">isMatchCurrentUrl</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#isPreload--">isPreload</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#notifyStateChange-int-int-android.os.Bundle-">notifyStateChange</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onClientPageFinished-java.lang.String-">onClientPageFinished</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onClientRequestResource-java.lang.String-">onClientRequestResource</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onServerClosed-com.tencent.sonic.sdk.SonicServer-boolean-">onServerClosed</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#postForceDestroyIfNeed--">postForceDestroyIfNeed</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#postTaskToSaveSonicCache-java.lang.String-">postTaskToSaveSonicCache</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#refresh--">refresh</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#removeSessionCallback-com.tencent.sonic.sdk.SonicSessionCallback-">removeSessionCallback</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#removeSessionStateChangedCallback-com.tencent.sonic.sdk.SonicSession.Callback-">removeSessionStateChangedCallback</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#setCookiesFromHeaders-java.util.Map-boolean-">setCookiesFromHeaders</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#setResult-int-int-boolean-">setResult</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#shouldSetCookieAsynchronous--">shouldSetCookieAsynchronous</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#start--">start</a>, <a href="../../../../com/tencent/sonic/sdk/SonicSession.html#switchState-int-int-boolean-">switchState</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>从类继承的方法 java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>方法详细资料</h3>
<a name="handleMessage-android.os.Message-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleMessage</h4>
<pre>public boolean handleMessage(android.os.Message msg)</pre>
<div class="block"><span class="descfrmTypeLabel">从类复制的说明: <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleMessage-android.os.Message-">SonicSession</a></code></span></div>
<div class="block">Subclasses must implement this to receive messages.</div>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code>handleMessage</code> 在接口中 <code>android.os.Handler.Callback</code></dd>
<dt><span class="overrideSpecifyLabel">覆盖:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleMessage-android.os.Message-">handleMessage</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
</dl>
</li>
</ul>
<a name="handleFlow_LoadLocalCache-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleFlow_LoadLocalCache</h4>
<pre>protected void handleFlow_LoadLocalCache(java.lang.String cacheHtml)</pre>
<div class="block">Handle load local cache of html if exist.
This handle is called before connection.</div>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_LoadLocalCache-java.lang.String-">handleFlow_LoadLocalCache</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
<dt><span class="paramLabel">参数:</span></dt>
<dd><code>cacheHtml</code> - local cache of html</dd>
</dl>
</li>
</ul>
<a name="onWebReady-com.tencent.sonic.sdk.SonicDiffDataCallback-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onWebReady</h4>
<pre>public boolean onWebReady(<a href="../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html" title="com.tencent.sonic.sdk中的接口">SonicDiffDataCallback</a> callback)</pre>
<div class="block"><span class="descfrmTypeLabel">从类复制的说明: <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onWebReady-com.tencent.sonic.sdk.SonicDiffDataCallback-">SonicSession</a></code></span></div>
<div class="block">Client will call this method to obtain the update data when the page shows the content.</div>
<dl>
<dt><span class="overrideSpecifyLabel">覆盖:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onWebReady-com.tencent.sonic.sdk.SonicDiffDataCallback-">onWebReady</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
<dt><span class="paramLabel">参数:</span></dt>
<dd><code>callback</code> - Sonic provides the latest data to the page through this callback</dd>
<dt><span class="returnLabel">返回:</span></dt>
<dd>The result</dd>
</dl>
</li>
</ul>
<a name="onClientReady--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onClientReady</h4>
<pre>public boolean onClientReady()</pre>
<div class="block"><span class="descfrmTypeLabel">从类复制的说明: <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onClientReady--">SonicSession</a></code></span></div>
<div class="block">Client informs sonic that it is ready.
Client ready means it's webview has been initialized, can start load url or load data.</div>
<dl>
<dt><span class="overrideSpecifyLabel">覆盖:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onClientReady--">onClientReady</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
<dt><span class="returnLabel">返回:</span></dt>
<dd>True if it is set for the first time</dd>
</dl>
</li>
</ul>
<a name="onRequestResource-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onRequestResource</h4>
<pre>protected java.lang.Object onRequestResource(java.lang.String url)</pre>
<div class="block"><span class="descfrmTypeLabel">从类复制的说明: <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onRequestResource-java.lang.String-">SonicSession</a></code></span></div>
<div class="block">When the webview initiates a main resource interception, the client invokes this method to retrieve the data</div>
<dl>
<dt><span class="overrideSpecifyLabel">覆盖:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#onRequestResource-java.lang.String-">onRequestResource</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
<dt><span class="paramLabel">参数:</span></dt>
<dd><code>url</code> - The url of this session</dd>
<dt><span class="returnLabel">返回:</span></dt>
<dd>Return the data to kernel</dd>
</dl>
</li>
</ul>
<a name="handleFlow_HttpError-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleFlow_HttpError</h4>
<pre>protected void handleFlow_HttpError(int responseCode)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_HttpError-int-">handleFlow_HttpError</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
</dl>
</li>
</ul>
<a name="handleFlow_ServiceUnavailable--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleFlow_ServiceUnavailable</h4>
<pre>protected void handleFlow_ServiceUnavailable()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_ServiceUnavailable--">handleFlow_ServiceUnavailable</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
</dl>
</li>
</ul>
<a name="handleFlow_TemplateChange-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleFlow_TemplateChange</h4>
<pre>protected void handleFlow_TemplateChange(java.lang.String newHtml)</pre>
<div class="block">In this case sonic will always read the new data from the server until the local page finish.
If the server data is read finished, sonic will send a <code>CLIENT_CORE_MSG_TEMPLATE_CHANGE</code>
message.
If the server data is not read finished sonic will split the read and unread data into a
bridgedStream<a href="../../../../com/tencent/sonic/sdk/SonicSessionStream.html" title="com.tencent.sonic.sdk中的类"><code>SonicSessionStream</code></a>. When the client initiates a resource interception,
sonic will provide the bridgedStream to the kernel.
<p>
If need save and separate data, sonic will save the server data and separate the server data to template and data.</div>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_TemplateChange-java.lang.String-">handleFlow_TemplateChange</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
<dt><span class="paramLabel">参数:</span></dt>
<dd><code>newHtml</code> - html content from server</dd>
</dl>
</li>
</ul>
<a name="handleFlow_FirstLoad--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleFlow_FirstLoad</h4>
<pre>protected void handleFlow_FirstLoad()</pre>
<div class="block">In this case sonic will always read the new data from the server until the client
initiates a resource interception.
If the server data is read finished, sonic will send <code>CLIENT_CORE_MSG_FIRST_LOAD</code>
message with the new html content from server.
If the server data is not read finished sonic will split the read and unread data into
a bridgedStream<a href="../../../../com/tencent/sonic/sdk/SonicSessionStream.html" title="com.tencent.sonic.sdk中的类"><code>SonicSessionStream</code></a>.When client initiates a resource interception,
sonic will provide the bridgedStream to the kernel.
<p>
If need save and separate data, sonic will save the server data and separate the server data
to template and data.</div>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_FirstLoad--">handleFlow_FirstLoad</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
</dl>
</li>
</ul>
<a name="handleFlow_DataUpdate-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleFlow_DataUpdate</h4>
<pre>protected void handleFlow_DataUpdate(java.lang.String serverRsp)</pre>
<div class="block">In this case sonic obtains the difference data between the server and the local
data first,then sonic will build the template and server data into html,
then send a <code>CLIENT_CORE_MSG_DATA_UPDATE</code> message.</div>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#handleFlow_DataUpdate-java.lang.String-">handleFlow_DataUpdate</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
<dt><span class="paramLabel">参数:</span></dt>
<dd><code>serverRsp</code> - Server response data</dd>
</dl>
</li>
</ul>
<a name="clearSessionData--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>clearSessionData</h4>
<pre>protected void clearSessionData()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">覆盖:</span></dt>
<dd><code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html#clearSessionData--">clearSessionData</a></code> 在类中 <code><a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个类</li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/QuickSonicSession.html" target="_top">框架</a></li>
<li><a href="QuickSonicSession.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li><a href="#nested.classes.inherited.from.class.com.tencent.sonic.sdk.SonicSession">嵌套</a> | </li>
<li><a href="#fields.inherited.from.class.com.tencent.sonic.sdk.SonicSession">字段</a> | </li>
<li>构造器 | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicCacheInterceptor.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:57 CST 2018 -->
<title>SonicCacheInterceptor (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SonicCacheInterceptor (sdk 3.0.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":10};
var tabs = {65535:["t0","所有方法"],2:["t2","实例方法"],4:["t3","抽象方法"],8:["t4","具体方法"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicCacheInterceptor.html" target="_top">框架</a></li>
<li><a href="SonicCacheInterceptor.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li><a href="#field.summary">字段</a> | </li>
<li><a href="#constructor.summary">构造器</a> | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li><a href="#field.detail">字段</a> | </li>
<li><a href="#constructor.detail">构造器</a> | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.tencent.sonic.sdk</div>
<h2 title="类 SonicCacheInterceptor" class="title">类 SonicCacheInterceptor</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.tencent.sonic.sdk.SonicCacheInterceptor</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">SonicCacheInterceptor</span>
extends java.lang.Object</pre>
<div class="block"><code>SonicCacheInterceptor</code> provide local data.
if a <a href="../../../../com/tencent/sonic/sdk/SonicSessionConfig.html" title="com.tencent.sonic.sdk中的类"><code>SonicSessionConfig</code></a> does not set a sonicCacheInterceptor
sonic will use <a href="../../../../com/tencent/sonic/sdk/SonicSessionConnection.SessionConnectionDefaultImpl.html" title="com.tencent.sonic.sdk中的类"><code>SonicSessionConnection.SessionConnectionDefaultImpl</code></a> as default.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>字段概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="字段概要表, 列表字段和解释">
<caption><span>字段</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">字段和说明</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html#TAG">TAG</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>构造器概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="构造器概要表, 列表构造器和解释">
<caption><span>构造器</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">构造器和说明</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html#SonicCacheInterceptor-com.tencent.sonic.sdk.SonicCacheInterceptor-">SonicCacheInterceptor</a></span>(<a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类">SonicCacheInterceptor</a> next)</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>方法概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="方法概要表, 列表方法和解释">
<caption><span id="t0" class="activeTableTab"><span>所有方法</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">实例方法</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">具体方法</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">方法和说明</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>abstract java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html#getCacheData-com.tencent.sonic.sdk.SonicSession-">getCacheData</a></span>(<a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a> session)</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类">SonicCacheInterceptor</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html#next--">next</a></span>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>从类继承的方法 java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>字段详细资料</h3>
<a name="TAG">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TAG</h4>
<pre>public static final java.lang.String TAG</pre>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicCacheInterceptor.TAG">常量字段值</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>构造器详细资料</h3>
<a name="SonicCacheInterceptor-com.tencent.sonic.sdk.SonicCacheInterceptor-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SonicCacheInterceptor</h4>
<pre>public SonicCacheInterceptor(<a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类">SonicCacheInterceptor</a> next)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>方法详细资料</h3>
<a name="next--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>next</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类">SonicCacheInterceptor</a> next()</pre>
</li>
</ul>
<a name="getCacheData-com.tencent.sonic.sdk.SonicSession-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getCacheData</h4>
<pre>public abstract java.lang.String getCacheData(<a href="../../../../com/tencent/sonic/sdk/SonicSession.html" title="com.tencent.sonic.sdk中的类">SonicSession</a> session)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/QuickSonicSession.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicCacheInterceptor.html" target="_top">框架</a></li>
<li><a href="SonicCacheInterceptor.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li><a href="#field.summary">字段</a> | </li>
<li><a href="#constructor.summary">构造器</a> | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li><a href="#field.detail">字段</a> | </li>
<li><a href="#constructor.detail">构造器</a> | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicConfig.Builder.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:57 CST 2018 -->
<title>SonicConfig.Builder (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SonicConfig.Builder (sdk 3.0.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
var tabs = {65535:["t0","所有方法"],2:["t2","实例方法"],8:["t4","具体方法"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicConfig.Builder.html" target="_top">框架</a></li>
<li><a href="SonicConfig.Builder.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li>字段 | </li>
<li><a href="#constructor.summary">构造器</a> | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li><a href="#constructor.detail">构造器</a> | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.tencent.sonic.sdk</div>
<h2 title="类 SonicConfig.Builder" class="title">类 SonicConfig.Builder</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.tencent.sonic.sdk.SonicConfig.Builder</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>封闭类:</dt>
<dd><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类">SonicConfig</a></dd>
</dl>
<hr>
<br>
<pre>public static class <span class="typeNameLabel">SonicConfig.Builder</span>
extends java.lang.Object</pre>
<div class="block">Builder for SonicConfig</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>构造器概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="构造器概要表, 列表构造器和解释">
<caption><span>构造器</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">构造器和说明</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#Builder--">Builder</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>方法概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="方法概要表, 列表方法和解释">
<caption><span id="t0" class="activeTableTab"><span>所有方法</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">实例方法</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">具体方法</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">方法和说明</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类">SonicConfig</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#build--">build</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setAutoInitDBWhenCreate-boolean-">setAutoInitDBWhenCreate</a></span>(boolean autoInitDBWhenCreate)</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setCacheCheckTimeInterval-long-">setCacheCheckTimeInterval</a></span>(long time)</code> </td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setCacheMaxSize-long-">setCacheMaxSize</a></span>(long maxSize)</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setCacheVerifyWithSha1-boolean-">setCacheVerifyWithSha1</a></span>(boolean enable)</code> </td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setGetCookieWhenSessionCreate-boolean-">setGetCookieWhenSessionCreate</a></span>(boolean value)</code> </td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setMaxNumOfDownloadingTasks-int-">setMaxNumOfDownloadingTasks</a></span>(int num)</code> </td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setMaxPreloadSessionCount-int-">setMaxPreloadSessionCount</a></span>(int maxPreloadSessionCount)</code> </td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setResourceCacheMaxSize-long-">setResourceCacheMaxSize</a></span>(long maxSize)</code> </td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setSonicCacheMaxAge-int-">setSonicCacheMaxAge</a></span>(int maxAge)</code> </td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html#setUnavailableTime-long-">setUnavailableTime</a></span>(long unavailableTime)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>从类继承的方法 java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>构造器详细资料</h3>
<a name="Builder--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Builder</h4>
<pre>public Builder()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>方法详细资料</h3>
<a name="setMaxPreloadSessionCount-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxPreloadSessionCount</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setMaxPreloadSessionCount(int maxPreloadSessionCount)</pre>
</li>
</ul>
<a name="setUnavailableTime-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setUnavailableTime</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setUnavailableTime(long unavailableTime)</pre>
</li>
</ul>
<a name="setCacheVerifyWithSha1-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCacheVerifyWithSha1</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setCacheVerifyWithSha1(boolean enable)</pre>
</li>
</ul>
<a name="setCacheMaxSize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCacheMaxSize</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setCacheMaxSize(long maxSize)</pre>
</li>
</ul>
<a name="setResourceCacheMaxSize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setResourceCacheMaxSize</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setResourceCacheMaxSize(long maxSize)</pre>
</li>
</ul>
<a name="setCacheCheckTimeInterval-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCacheCheckTimeInterval</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setCacheCheckTimeInterval(long time)</pre>
</li>
</ul>
<a name="setMaxNumOfDownloadingTasks-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxNumOfDownloadingTasks</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setMaxNumOfDownloadingTasks(int num)</pre>
</li>
</ul>
<a name="setAutoInitDBWhenCreate-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAutoInitDBWhenCreate</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setAutoInitDBWhenCreate(boolean autoInitDBWhenCreate)</pre>
</li>
</ul>
<a name="setGetCookieWhenSessionCreate-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setGetCookieWhenSessionCreate</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setGetCookieWhenSessionCreate(boolean value)</pre>
</li>
</ul>
<a name="setSonicCacheMaxAge-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSonicCacheMaxAge</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a> setSonicCacheMaxAge(int maxAge)</pre>
</li>
</ul>
<a name="build--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>build</h4>
<pre>public <a href="../../../../com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类">SonicConfig</a> build()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicConfig.Builder.html" target="_top">框架</a></li>
<li><a href="SonicConfig.Builder.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li>字段 | </li>
<li><a href="#constructor.summary">构造器</a> | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li><a href="#constructor.detail">构造器</a> | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicConfig.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:57 CST 2018 -->
<title>SonicConfig (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SonicConfig (sdk 3.0.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicConfig.html" target="_top">框架</a></li>
<li><a href="SonicConfig.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li><a href="#nested.class.summary">嵌套</a> | </li>
<li><a href="#field.summary">字段</a> | </li>
<li>构造器 | </li>
<li><a href="#methods.inherited.from.class.java.lang.Object">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li><a href="#field.detail">字段</a> | </li>
<li>构造器 | </li>
<li>方法</li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.tencent.sonic.sdk</div>
<h2 title="类 SonicConfig" class="title">类 SonicConfig</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.tencent.sonic.sdk.SonicConfig</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">SonicConfig</span>
extends java.lang.Object</pre>
<div class="block">Sonic global config</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>嵌套类概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="嵌套类概要表, 列表嵌套类和解释">
<caption><span>嵌套类</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">类和说明</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类">SonicConfig.Builder</a></span></code>
<div class="block">Builder for SonicConfig</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>字段概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="字段概要表, 列表字段和解释">
<caption><span>字段</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">字段和说明</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html#SONIC_MAX_NUM_OF_DOWNLOADING_TASK">SONIC_MAX_NUM_OF_DOWNLOADING_TASK</a></span></code>
<div class="block">The max number of tasks which is downloading in the same time.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConfig.html#VERIFY_CACHE_FILE_WITH_SHA1">VERIFY_CACHE_FILE_WITH_SHA1</a></span></code>
<div class="block">Whether verify file by compare SHA1.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>方法概要</h3>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>从类继承的方法 java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>字段详细资料</h3>
<a name="SONIC_MAX_NUM_OF_DOWNLOADING_TASK">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SONIC_MAX_NUM_OF_DOWNLOADING_TASK</h4>
<pre>public int SONIC_MAX_NUM_OF_DOWNLOADING_TASK</pre>
<div class="block">The max number of tasks which is downloading in the same time.</div>
</li>
</ul>
<a name="VERIFY_CACHE_FILE_WITH_SHA1">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>VERIFY_CACHE_FILE_WITH_SHA1</h4>
<pre>public boolean VERIFY_CACHE_FILE_WITH_SHA1</pre>
<div class="block">Whether verify file by compare SHA1. If this value is false, sonic will verify file by file's size.
Verify the file size is less time consuming than checking SHA1.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicCacheInterceptor.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicConfig.html" target="_top">框架</a></li>
<li><a href="SonicConfig.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li><a href="#nested.class.summary">嵌套</a> | </li>
<li><a href="#field.summary">字段</a> | </li>
<li>构造器 | </li>
<li><a href="#methods.inherited.from.class.java.lang.Object">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li><a href="#field.detail">字段</a> | </li>
<li>构造器 | </li>
<li>方法</li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicConstants.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:57 CST 2018 -->
<title>SonicConstants (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SonicConstants (sdk 3.0.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicConstants.html" target="_top">框架</a></li>
<li><a href="SonicConstants.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li><a href="#field.summary">字段</a> | </li>
<li><a href="#constructor.summary">构造器</a> | </li>
<li><a href="#methods.inherited.from.class.java.lang.Object">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li><a href="#field.detail">字段</a> | </li>
<li><a href="#constructor.detail">构造器</a> | </li>
<li>方法</li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.tencent.sonic.sdk</div>
<h2 title="类 SonicConstants" class="title">类 SonicConstants</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.tencent.sonic.sdk.SonicConstants</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">SonicConstants</span>
extends java.lang.Object</pre>
<div class="block">Sonic constants</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>字段概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="字段概要表, 列表字段和解释">
<caption><span>字段</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">字段和说明</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_BUILD_HTML_ERROR">ERROR_CODE_BUILD_HTML_ERROR</a></span></code>
<div class="block">Build template and data to html failed</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_CONNECT_IOE">ERROR_CODE_CONNECT_IOE</a></span></code>
<div class="block">Http(s) connection error : IO Exception</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_CONNECT_NPE">ERROR_CODE_CONNECT_NPE</a></span></code>
<div class="block">Http(s) connection error : nullPointer in native</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_CONNECT_TOE">ERROR_CODE_CONNECT_TOE</a></span></code>
<div class="block">Http(s) connection error : time out</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_DATA_VERIFY_FAIL">ERROR_CODE_DATA_VERIFY_FAIL</a></span></code>
<div class="block">Verify local file failed</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_MAKE_DIR_ERROR">ERROR_CODE_MAKE_DIR_ERROR</a></span></code>
<div class="block">Failed to create sonic directory</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_MERGE_DIFF_DATA_FAIL">ERROR_CODE_MERGE_DIFF_DATA_FAIL</a></span></code>
<div class="block">Obtain difference data between server and local data failed</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_SERVER_DATA_EXCEPTION">ERROR_CODE_SERVER_DATA_EXCEPTION</a></span></code>
<div class="block">Server data exception</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_SPLIT_HTML_FAIL">ERROR_CODE_SPLIT_HTML_FAIL</a></span></code>
<div class="block">Separate html to template and data failed</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_SUCCESS">ERROR_CODE_SUCCESS</a></span></code>
<div class="block">Success</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_UNKNOWN">ERROR_CODE_UNKNOWN</a></span></code>
<div class="block">Unknown</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#ERROR_CODE_WRITE_FILE_FAIL">ERROR_CODE_WRITE_FILE_FAIL</a></span></code>
<div class="block">File save failed</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SESSION_MODE_DEFAULT">SESSION_MODE_DEFAULT</a></span></code>
<div class="block">SonicSession mode : StandardSonicSession</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SESSION_MODE_QUICK">SESSION_MODE_QUICK</a></span></code>
<div class="block">SonicSession mode : QuickSonicSession</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SONIC_PARAMETER_NAME_PREFIX">SONIC_PARAMETER_NAME_PREFIX</a></span></code>
<div class="block">Sonic parameter prefix</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SONIC_REMAIN_PARAMETER_NAMES">SONIC_REMAIN_PARAMETER_NAMES</a></span></code>
<div class="block">This parameter in url will be as part of session id,and it is separated by SONIC_REMAIN_PARAMETER_SPLIT_CHAR.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SONIC_REMAIN_PARAMETER_SPLIT_CHAR">SONIC_REMAIN_PARAMETER_SPLIT_CHAR</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SONIC_SDK_LOG_PREFIX">SONIC_SDK_LOG_PREFIX</a></span></code>
<div class="block">SonicSDK log prefix</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SONIC_VERSION_NUM">SONIC_VERSION_NUM</a></span></code>
<div class="block">SonicSDK version</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>构造器概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="构造器概要表, 列表构造器和解释">
<caption><span>构造器</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">构造器和说明</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html#SonicConstants--">SonicConstants</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>方法概要</h3>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>从类继承的方法 java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>字段详细资料</h3>
<a name="SONIC_SDK_LOG_PREFIX">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SONIC_SDK_LOG_PREFIX</h4>
<pre>public static final java.lang.String SONIC_SDK_LOG_PREFIX</pre>
<div class="block">SonicSDK log prefix</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.SONIC_SDK_LOG_PREFIX">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="SONIC_VERSION_NUM">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SONIC_VERSION_NUM</h4>
<pre>public static final java.lang.String SONIC_VERSION_NUM</pre>
<div class="block">SonicSDK version</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.SONIC_VERSION_NUM">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="SONIC_PARAMETER_NAME_PREFIX">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SONIC_PARAMETER_NAME_PREFIX</h4>
<pre>public static final java.lang.String SONIC_PARAMETER_NAME_PREFIX</pre>
<div class="block">Sonic parameter prefix</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.SONIC_PARAMETER_NAME_PREFIX">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="SONIC_REMAIN_PARAMETER_NAMES">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SONIC_REMAIN_PARAMETER_NAMES</h4>
<pre>public static final java.lang.String SONIC_REMAIN_PARAMETER_NAMES</pre>
<div class="block">This parameter in url will be as part of session id,and it is separated by SONIC_REMAIN_PARAMETER_SPLIT_CHAR.</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.SONIC_REMAIN_PARAMETER_NAMES">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="SONIC_REMAIN_PARAMETER_SPLIT_CHAR">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SONIC_REMAIN_PARAMETER_SPLIT_CHAR</h4>
<pre>public static final java.lang.String SONIC_REMAIN_PARAMETER_SPLIT_CHAR</pre>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.SONIC_REMAIN_PARAMETER_SPLIT_CHAR">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="SESSION_MODE_DEFAULT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SESSION_MODE_DEFAULT</h4>
<pre>public static final int SESSION_MODE_DEFAULT</pre>
<div class="block">SonicSession mode : StandardSonicSession</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.SESSION_MODE_DEFAULT">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="SESSION_MODE_QUICK">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SESSION_MODE_QUICK</h4>
<pre>public static final int SESSION_MODE_QUICK</pre>
<div class="block">SonicSession mode : QuickSonicSession</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.SESSION_MODE_QUICK">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_UNKNOWN">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_UNKNOWN</h4>
<pre>public static final int ERROR_CODE_UNKNOWN</pre>
<div class="block">Unknown</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_UNKNOWN">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_SUCCESS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_SUCCESS</h4>
<pre>public static final int ERROR_CODE_SUCCESS</pre>
<div class="block">Success</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_SUCCESS">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_CONNECT_IOE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_CONNECT_IOE</h4>
<pre>public static final int ERROR_CODE_CONNECT_IOE</pre>
<div class="block">Http(s) connection error : IO Exception</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_CONNECT_IOE">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_CONNECT_TOE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_CONNECT_TOE</h4>
<pre>public static final int ERROR_CODE_CONNECT_TOE</pre>
<div class="block">Http(s) connection error : time out</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_CONNECT_TOE">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_CONNECT_NPE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_CONNECT_NPE</h4>
<pre>public static final int ERROR_CODE_CONNECT_NPE</pre>
<div class="block">Http(s) connection error : nullPointer in native</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_CONNECT_NPE">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_DATA_VERIFY_FAIL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_DATA_VERIFY_FAIL</h4>
<pre>public static final int ERROR_CODE_DATA_VERIFY_FAIL</pre>
<div class="block">Verify local file failed</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_DATA_VERIFY_FAIL">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_MAKE_DIR_ERROR">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_MAKE_DIR_ERROR</h4>
<pre>public static final int ERROR_CODE_MAKE_DIR_ERROR</pre>
<div class="block">Failed to create sonic directory</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_MAKE_DIR_ERROR">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_WRITE_FILE_FAIL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_WRITE_FILE_FAIL</h4>
<pre>public static final int ERROR_CODE_WRITE_FILE_FAIL</pre>
<div class="block">File save failed</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_WRITE_FILE_FAIL">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_SPLIT_HTML_FAIL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_SPLIT_HTML_FAIL</h4>
<pre>public static final int ERROR_CODE_SPLIT_HTML_FAIL</pre>
<div class="block">Separate html to template and data failed</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_SPLIT_HTML_FAIL">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_MERGE_DIFF_DATA_FAIL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_MERGE_DIFF_DATA_FAIL</h4>
<pre>public static final int ERROR_CODE_MERGE_DIFF_DATA_FAIL</pre>
<div class="block">Obtain difference data between server and local data failed</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_MERGE_DIFF_DATA_FAIL">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_SERVER_DATA_EXCEPTION">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ERROR_CODE_SERVER_DATA_EXCEPTION</h4>
<pre>public static final int ERROR_CODE_SERVER_DATA_EXCEPTION</pre>
<div class="block">Server data exception</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_SERVER_DATA_EXCEPTION">常量字段值</a></dd>
</dl>
</li>
</ul>
<a name="ERROR_CODE_BUILD_HTML_ERROR">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ERROR_CODE_BUILD_HTML_ERROR</h4>
<pre>public static final int ERROR_CODE_BUILD_HTML_ERROR</pre>
<div class="block">Build template and data to html failed</div>
<dl>
<dt><span class="seeLabel">另请参阅:</span></dt>
<dd><a href="../../../../constant-values.html#com.tencent.sonic.sdk.SonicConstants.ERROR_CODE_BUILD_HTML_ERROR">常量字段值</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>构造器详细资料</h3>
<a name="SonicConstants--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SonicConstants</h4>
<pre>public SonicConstants()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicConfig.Builder.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicConstants.html" target="_top">框架</a></li>
<li><a href="SonicConstants.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li><a href="#field.summary">字段</a> | </li>
<li><a href="#constructor.summary">构造器</a> | </li>
<li><a href="#methods.inherited.from.class.java.lang.Object">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li><a href="#field.detail">字段</a> | </li>
<li><a href="#constructor.detail">构造器</a> | </li>
<li>方法</li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicDBHelper.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:57 CST 2018 -->
<title>SonicDBHelper (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SonicDBHelper (sdk 3.0.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":10,"i3":10};
var tabs = {65535:["t0","所有方法"],1:["t1","静态方法"],2:["t2","实例方法"],8:["t4","具体方法"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html" title="com.tencent.sonic.sdk中的接口"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicDBHelper.html" target="_top">框架</a></li>
<li><a href="SonicDBHelper.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.tencent.sonic.sdk</div>
<h2 title="类 SonicDBHelper" class="title">类 SonicDBHelper</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>android.database.sqlite.SQLiteOpenHelper</li>
<li>
<ul class="inheritance">
<li>com.tencent.sonic.sdk.SonicDBHelper</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">SonicDBHelper</span>
extends android.database.sqlite.SQLiteOpenHelper</pre>
<div class="block">SonicDBHelper interacts with the database, such as managing database creation and
the version management.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>方法概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="方法概要表, 列表方法和解释">
<caption><span id="t0" class="activeTableTab"><span>所有方法</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">静态方法</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">实例方法</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">具体方法</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">方法和说明</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类">SonicDBHelper</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html#getInstance--">getInstance</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html#isUpgrading--">isUpgrading</a></span>()</code>
<div class="block">Indicates whether is upgrading or not.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html#onCreate-android.database.sqlite.SQLiteDatabase-">onCreate</a></span>(android.database.sqlite.SQLiteDatabase db)</code>
<div class="block">Called when the database is created for the first time.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html#onUpgrade-android.database.sqlite.SQLiteDatabase-int-int-">onUpgrade</a></span>(android.database.sqlite.SQLiteDatabase db,
int oldVersion,
int newVersion)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.android.database.sqlite.SQLiteOpenHelper">
<!-- -->
</a>
<h3>从类继承的方法 android.database.sqlite.SQLiteOpenHelper</h3>
<code>close, getDatabaseName, getReadableDatabase, getWritableDatabase, onConfigure, onDowngrade, onOpen, setWriteAheadLoggingEnabled</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>从类继承的方法 java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>方法详细资料</h3>
<a name="getInstance--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInstance</h4>
<pre>public static <a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类">SonicDBHelper</a> getInstance()</pre>
</li>
</ul>
<a name="onCreate-android.database.sqlite.SQLiteDatabase-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onCreate</h4>
<pre>public void onCreate(android.database.sqlite.SQLiteDatabase db)</pre>
<div class="block">Called when the database is created for the first time. This is where the
creation of tables and the initial population of the tables should happen.</div>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code>onCreate</code> 在类中 <code>android.database.sqlite.SQLiteOpenHelper</code></dd>
<dt><span class="paramLabel">参数:</span></dt>
<dd><code>db</code> - The database.</dd>
</dl>
</li>
</ul>
<a name="onUpgrade-android.database.sqlite.SQLiteDatabase-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onUpgrade</h4>
<pre>public void onUpgrade(android.database.sqlite.SQLiteDatabase db,
int oldVersion,
int newVersion)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">指定者:</span></dt>
<dd><code>onUpgrade</code> 在类中 <code>android.database.sqlite.SQLiteOpenHelper</code></dd>
</dl>
</li>
</ul>
<a name="isUpgrading--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isUpgrading</h4>
<pre>public boolean isUpgrading()</pre>
<div class="block">Indicates whether is upgrading or not. If return true, It will fail to create session.</div>
<dl>
<dt><span class="returnLabel">返回:</span></dt>
<dd>is Upgrading or not</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicConstants.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html" title="com.tencent.sonic.sdk中的接口"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicDBHelper.html" target="_top">框架</a></li>
<li><a href="SonicDBHelper.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
================================================
FILE: sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicDiffDataCallback.html
================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Apr 18 15:55:57 CST 2018 -->
<title>SonicDiffDataCallback (sdk 3.0.0 API)</title>
<meta name="date" content="2018-04-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SonicDiffDataCallback (sdk 3.0.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6};
var tabs = {65535:["t0","所有方法"],2:["t2","实例方法"],4:["t3","抽象方法"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicEngine.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicDiffDataCallback.html" target="_top">框架</a></li>
<li><a href="SonicDiffDataCallback.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.tencent.sonic.sdk</div>
<h2 title="接口 SonicDiffDataCallback" class="title">接口 SonicDiffDataCallback</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">SonicDiffDataCallback</span></pre>
<div class="block">This interface is used to call the difference data between local and server data
to the client.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>方法概要</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="方法概要表, 列表方法和解释">
<caption><span id="t0" class="activeTableTab"><span>所有方法</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">实例方法</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th class="colLast" scope="col">方法和说明</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html#callback-java.lang.String-">callback</a></span>(java.lang.String resultData)</code>
<div class="block">Called when sonic processes the local data and the server data.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>方法详细资料</h3>
<a name="callback-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>callback</h4>
<pre>void callback(java.lang.String resultData)</pre>
<div class="block">Called when sonic processes the local data and the server data.
When the page requests the latest data, sonic will send the latest
data to page by this method.</div>
<dl>
<dt><span class="paramLabel">参数:</span></dt>
<dd><code>resultData</code> - The result to page.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="package-summary.html">程序包</a></li>
<li class="navBarCell1Rev">类</li>
<li><a href="package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/tencent/sonic/sdk/SonicDBHelper.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">上一个类</span></a></li>
<li><a href="../../../../com/tencent/sonic/sdk/SonicEngine.html" title="com.tencent.sonic.sdk中的类"><span class="typeNameLink">下一个类</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tencent/sonic/sdk/SonicDiffDataCallback.html" target="_top">框架</a></li>
<li><a href="SonicDiffDataCallback.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>概要: </li>
<li>嵌套 | </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.summary">方法</a></li>
</ul>
<ul class="subNavList">
<li>详细资料: </li>
<li>字段 | </li>
<li>构造器 | </li>
<li><a href="#method.detail">方法</a></li>
</ul>
</div>
gitextract_nx2cxqfl/
├── .gitignore
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
├── LICENSE
├── README.md
├── assets/
│ ├── Sonic2.0.md
│ ├── VasSonic3.0_preload.md
│ └── sonic发展历程.md
├── checkstyle.xml
├── sonic-android/
│ ├── .gitignore
│ ├── README.md
│ ├── build.gradle
│ ├── docs/
│ │ ├── Sonic Quick模式实现原理.md
│ │ ├── Sonic Standard模式实现原理.md
│ │ ├── Sonic接入指引.md
│ │ ├── Sonic框架介绍.md
│ │ ├── javadoc/
│ │ │ ├── allclasses-frame.html
│ │ │ ├── allclasses-noframe.html
│ │ │ ├── com/
│ │ │ │ └── tencent/
│ │ │ │ └── sonic/
│ │ │ │ └── sdk/
│ │ │ │ ├── QuickSonicSession.html
│ │ │ │ ├── SonicCacheInterceptor.html
│ │ │ │ ├── SonicConfig.Builder.html
│ │ │ │ ├── SonicConfig.html
│ │ │ │ ├── SonicConstants.html
│ │ │ │ ├── SonicDBHelper.html
│ │ │ │ ├── SonicDiffDataCallback.html
│ │ │ │ ├── SonicEngine.html
│ │ │ │ ├── SonicFileUtils.html
│ │ │ │ ├── SonicResourceDataHelper.ResourceData.html
│ │ │ │ ├── SonicResourceDataHelper.html
│ │ │ │ ├── SonicRuntime.html
│ │ │ │ ├── SonicServer.html
│ │ │ │ ├── SonicSession.Callback.html
│ │ │ │ ├── SonicSession.html
│ │ │ │ ├── SonicSessionClient.html
│ │ │ │ ├── SonicSessionConfig.Builder.html
│ │ │ │ ├── SonicSessionConfig.html
│ │ │ │ ├── SonicSessionConnection.SessionConnectionDefaultImpl.html
│ │ │ │ ├── SonicSessionConnection.html
│ │ │ │ ├── SonicSessionConnectionInterceptor.html
│ │ │ │ ├── SonicSessionStatistics.html
│ │ │ │ ├── SonicSessionStream.Callback.html
│ │ │ │ ├── SonicSessionStream.html
│ │ │ │ ├── SonicUtils.html
│ │ │ │ ├── StandardSonicSession.html
│ │ │ │ ├── download/
│ │ │ │ │ ├── SonicDownloadCache.SonicResourceCache.html
│ │ │ │ │ ├── SonicDownloadCache.html
│ │ │ │ │ ├── SonicDownloadCallback.SimpleDownloadCallback.html
│ │ │ │ │ ├── SonicDownloadCallback.html
│ │ │ │ │ ├── SonicDownloadClient.DownloadTask.html
│ │ │ │ │ ├── SonicDownloadClient.SonicDownloadConnection.html
│ │ │ │ │ ├── SonicDownloadClient.SubResourceDownloadCallback.html
│ │ │ │ │ ├── SonicDownloadClient.html
│ │ │ │ │ ├── SonicDownloadEngine.html
│ │ │ │ │ ├── package-frame.html
│ │ │ │ │ ├── package-summary.html
│ │ │ │ │ └── package-tree.html
│ │ │ │ ├── package-frame.html
│ │ │ │ ├── package-summary.html
│ │ │ │ └── package-tree.html
│ │ │ ├── constant-values.html
│ │ │ ├── deprecated-list.html
│ │ │ ├── help-doc.html
│ │ │ ├── index-all.html
│ │ │ ├── index.html
│ │ │ ├── overview-frame.html
│ │ │ ├── overview-summary.html
│ │ │ ├── overview-tree.html
│ │ │ ├── package-list
│ │ │ ├── script.js
│ │ │ └── stylesheet.css
│ │ └── sdk-3.0.0-javadoc.jar
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── sample/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── assets/
│ │ │ └── sonic-demo-index.html
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── tencent/
│ │ │ └── sonic/
│ │ │ └── demo/
│ │ │ ├── BrowserActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── SonicJavaScriptInterface.java
│ │ │ ├── SonicRuntimeImpl.java
│ │ │ ├── SonicSessionClientImpl.java
│ │ │ ├── UrlListAdapter.java
│ │ │ └── UrlSelector.java
│ │ └── res/
│ │ ├── drawable/
│ │ │ ├── ic_add_circle_accent_24dp.xml
│ │ │ ├── ic_add_circle_black_24dp.xml
│ │ │ ├── ic_add_circle_selector.xml
│ │ │ ├── ic_remove_circle_accent_24dp.xml
│ │ │ └── sonic_button_round_mask.xml
│ │ ├── layout/
│ │ │ ├── activity_browser.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── dialog_url.xml
│ │ │ └── list_item_url.xml
│ │ └── values/
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── sdk/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ ├── androidTest/
│ │ │ └── java/
│ │ │ └── com/
│ │ │ └── tencent/
│ │ │ └── sonic/
│ │ │ └── sdk/
│ │ │ ├── BaseSonicTest.java
│ │ │ ├── ExampleInstrumentedTest.java
│ │ │ ├── QuickSonicSessionTest.java
│ │ │ ├── SonicRuntimeImplTest.java
│ │ │ ├── SonicSessionClientImplTest.java
│ │ │ └── SonicTestData.java
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── tencent/
│ │ │ └── sonic/
│ │ │ └── sdk/
│ │ │ ├── QuickSonicSession.java
│ │ │ ├── SonicCacheInterceptor.java
│ │ │ ├── SonicConfig.java
│ │ │ ├── SonicConstants.java
│ │ │ ├── SonicDBHelper.java
│ │ │ ├── SonicDataHelper.java
│ │ │ ├── SonicDiffDataCallback.java
│ │ │ ├── SonicEngine.java
│ │ │ ├── SonicFileUtils.java
│ │ │ ├── SonicResourceDataHelper.java
│ │ │ ├── SonicRuntime.java
│ │ │ ├── SonicServer.java
│ │ │ ├── SonicSession.java
│ │ │ ├── SonicSessionCallback.java
│ │ │ ├── SonicSessionClient.java
│ │ │ ├── SonicSessionConfig.java
│ │ │ ├── SonicSessionConnection.java
│ │ │ ├── SonicSessionConnectionInterceptor.java
│ │ │ ├── SonicSessionStatistics.java
│ │ │ ├── SonicSessionStream.java
│ │ │ ├── SonicSessionThreadPool.java
│ │ │ ├── SonicSniSSLSocketFactory.java
│ │ │ ├── SonicUtils.java
│ │ │ ├── StandardSonicSession.java
│ │ │ └── download/
│ │ │ ├── SonicDownloadCache.java
│ │ │ ├── SonicDownloadCallback.java
│ │ │ ├── SonicDownloadClient.java
│ │ │ └── SonicDownloadEngine.java
│ │ └── res/
│ │ └── values/
│ │ └── strings.xml
│ └── settings.gradle
├── sonic-iOS/
│ ├── .gitignore
│ ├── README.md
│ ├── Sonic/
│ │ ├── Cache/
│ │ │ ├── SonicCache.h
│ │ │ ├── SonicCache.m
│ │ │ ├── SonicCacheItem.h
│ │ │ ├── SonicCacheItem.m
│ │ │ ├── SonicDatabase.h
│ │ │ └── SonicDatabase.m
│ │ ├── Engine/
│ │ │ ├── SonicConfiguration.h
│ │ │ ├── SonicConfiguration.m
│ │ │ ├── SonicEngine.h
│ │ │ └── SonicEngine.m
│ │ ├── Info.plist
│ │ ├── Network/
│ │ │ ├── SonicConnection.h
│ │ │ ├── SonicConnection.m
│ │ │ ├── SonicServer.h
│ │ │ ├── SonicServer.m
│ │ │ ├── SonicURLProtocol.h
│ │ │ └── SonicURLProtocol.m
│ │ ├── ResourceLoader/
│ │ │ ├── SonicResourceLoadOperation.h
│ │ │ ├── SonicResourceLoadOperation.m
│ │ │ ├── SonicResourceLoader.h
│ │ │ └── SonicResourceLoader.m
│ │ ├── Session/
│ │ │ ├── SonicSession.h
│ │ │ ├── SonicSession.m
│ │ │ ├── SonicSessionConfiguration.h
│ │ │ └── SonicSessionConfiguration.m
│ │ ├── Sonic.h
│ │ ├── SonicConstants.h
│ │ ├── SonicProtocol.h
│ │ ├── Statistics/
│ │ │ ├── SonicEventConstants.h
│ │ │ ├── SonicEventStatistics.h
│ │ │ └── SonicEventStatistics.m
│ │ └── Util/
│ │ ├── SonicUtil.h
│ │ └── SonicUtil.m
│ ├── Sonic.xcodeproj/
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace/
│ │ └── contents.xcworkspacedata
│ ├── Sonic.xcworkspace/
│ │ └── contents.xcworkspacedata
│ ├── SonicSample/
│ │ ├── SonicSample/
│ │ │ ├── 36f620dddab622727b270e6b79b20a98/
│ │ │ │ └── main.html
│ │ │ ├── AppDelegate.h
│ │ │ ├── AppDelegate.m
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Contents.json
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ ├── RootViewController.h
│ │ │ ├── RootViewController.m
│ │ │ ├── SonicEventObserver.h
│ │ │ ├── SonicEventObserver.m
│ │ │ ├── SonicJSContext.h
│ │ │ ├── SonicJSContext.m
│ │ │ ├── SonicOfflineCacheConnection.h
│ │ │ ├── SonicOfflineCacheConnection.m
│ │ │ ├── SonicWebViewController.h
│ │ │ ├── SonicWebViewController.m
│ │ │ └── main.m
│ │ ├── SonicSample.xcodeproj/
│ │ │ ├── project.pbxproj
│ │ │ └── project.xcworkspace/
│ │ │ └── contents.xcworkspacedata
│ │ └── SonicSampleUITests/
│ │ ├── Info.plist
│ │ └── SonicSampleUITests.m
│ └── docs/
│ ├── iOS终端实现原理.md
│ └── 终端接入指引-iOS版本.md
├── sonic-java/
│ ├── README.md
│ ├── apidocs/
│ │ ├── allclasses-frame.html
│ │ ├── allclasses-noframe.html
│ │ ├── com/
│ │ │ └── github/
│ │ │ └── tencent/
│ │ │ ├── AbstractReplaceCallBack.html
│ │ │ ├── HttpServletResponseCopier.html
│ │ │ ├── ReplaceCallBack.html
│ │ │ ├── ServletOutputStreamCopier.html
│ │ │ ├── SonicFilter.html
│ │ │ ├── SonicUtil.html
│ │ │ ├── class-use/
│ │ │ │ ├── AbstractReplaceCallBack.html
│ │ │ │ ├── HttpServletResponseCopier.html
│ │ │ │ ├── ReplaceCallBack.html
│ │ │ │ ├── ServletOutputStreamCopier.html
│ │ │ │ ├── SonicFilter.html
│ │ │ │ └── SonicUtil.html
│ │ │ ├── package-frame.html
│ │ │ ├── package-summary.html
│ │ │ ├── package-tree.html
│ │ │ └── package-use.html
│ │ ├── constant-values.html
│ │ ├── deprecated-list.html
│ │ ├── help-doc.html
│ │ ├── index-all.html
│ │ ├── index.html
│ │ ├── overview-tree.html
│ │ ├── package-list
│ │ ├── script.js
│ │ └── stylesheet.css
│ ├── lib/
│ │ ├── VasSonic-1.1-javadoc.jar
│ │ ├── VasSonic-1.1-sources.jar
│ │ └── VasSonic-1.1.jar
│ ├── sample/
│ │ └── webapp/
│ │ ├── WEB-INF/
│ │ │ ├── lib/
│ │ │ │ └── VasSonic-1.1.jar
│ │ │ └── web.xml
│ │ └── index.jsp
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── github/
│ └── tencent/
│ ├── AbstractReplaceCallBack.java
│ ├── HttpServletResponseCopier.java
│ ├── ReplaceCallBack.java
│ ├── ServletOutputStreamCopier.java
│ ├── SonicFilter.java
│ └── SonicUtil.java
├── sonic-nodejs/
│ ├── .gitignore
│ ├── README.md
│ ├── README_CN.md
│ ├── app.js
│ ├── assets/
│ │ ├── build/
│ │ │ └── gulpfile.js
│ │ ├── package.json
│ │ ├── page/
│ │ │ ├── demo1.ejs
│ │ │ ├── demo1.js
│ │ │ ├── demo2-data.js
│ │ │ ├── demo2.ejs
│ │ │ ├── demo2.js
│ │ │ ├── demo3-data.js
│ │ │ ├── demo3.ejs
│ │ │ ├── demo3.js
│ │ │ ├── index.ejs
│ │ │ ├── index.js
│ │ │ └── tpls/
│ │ │ ├── common_body_header.ejs
│ │ │ ├── common_body_header.js
│ │ │ ├── common_header.ejs
│ │ │ ├── common_header.js
│ │ │ ├── common_meta.ejs
│ │ │ └── common_meta.js
│ │ └── project.config.js
│ ├── common/
│ │ └── diff.js
│ ├── middleware/
│ │ └── compress.js
│ ├── package.json
│ └── router/
│ ├── config.js
│ └── index.js
├── sonic-php/
│ ├── README.md
│ ├── sample/
│ │ ├── README.md
│ │ ├── controller/
│ │ │ └── demo.php
│ │ ├── index.php
│ │ ├── js/
│ │ │ └── sonic-3.js
│ │ ├── util/
│ │ │ └── sonic.php
│ │ └── view/
│ │ └── demo_template.php
│ └── sdk/
│ └── sonic.php
└── sonic-react/
├── README.md
├── README_CN.md
├── components/
│ ├── GameArea.js
│ ├── GameFooter.js
│ └── GameHeader.js
├── containers/
│ └── GameContainer.js
├── package.json
├── pages/
│ └── demo.js
├── redux/
│ └── duck.js
├── server.js
└── static/
└── js/
└── flexible.js
SYMBOL INDEX (620 symbols across 64 files)
FILE: sonic-android/docs/javadoc/script.js
function show (line 1) | function show(type)
function updateTabs (line 16) | function updateTabs(type)
FILE: sonic-android/sample/src/main/java/com/tencent/sonic/demo/BrowserActivity.java
class BrowserActivity (line 59) | public class BrowserActivity extends Activity {
method onCreate (line 68) | @Override
method onBackPressed (line 194) | @Override
method onDestroy (line 199) | @Override
class OfflinePkgSessionConnection (line 209) | private static class OfflinePkgSessionConnection extends SonicSessionC...
method OfflinePkgSessionConnection (line 213) | public OfflinePkgSessionConnection(Context context, SonicSession ses...
method internalConnect (line 218) | @Override
method internalGetResponseStream (line 233) | @Override
method internalGetCustomHeadFieldEtag (line 238) | @Override
method disconnect (line 243) | @Override
method getResponseCode (line 254) | @Override
method getResponseHeaderFields (line 259) | @Override
method getResponseHeaderField (line 264) | @Override
FILE: sonic-android/sample/src/main/java/com/tencent/sonic/demo/MainActivity.java
class MainActivity (line 39) | public class MainActivity extends Activity {
method onCreate (line 51) | @Override
method init (line 136) | private void init() {
method hasPermission (line 144) | private boolean hasPermission() {
method requestPermission (line 151) | private void requestPermission() {
method onRequestPermissionsResult (line 157) | @Override
method startBrowserActivity (line 170) | private void startBrowserActivity(int mode) {
FILE: sonic-android/sample/src/main/java/com/tencent/sonic/demo/SonicJavaScriptInterface.java
class SonicJavaScriptInterface (line 30) | public class SonicJavaScriptInterface {
method SonicJavaScriptInterface (line 40) | public SonicJavaScriptInterface(SonicSessionClientImpl sessionClient, ...
method getDiffData (line 45) | @JavascriptInterface
method getDiffData2 (line 51) | @JavascriptInterface
method getPerformance (line 74) | @JavascriptInterface
method toJsString (line 95) | private static String toJsString(String value) {
FILE: sonic-android/sample/src/main/java/com/tencent/sonic/demo/SonicRuntimeImpl.java
class SonicRuntimeImpl (line 38) | public class SonicRuntimeImpl extends SonicRuntime {
method SonicRuntimeImpl (line 40) | public SonicRuntimeImpl(Context context) {
method getUserAgent (line 48) | @Override
method getCurrentUserAccount (line 57) | @Override
method getCookie (line 62) | @Override
method log (line 68) | @Override
method createWebResourceResponse (line 82) | @Override
method showToast (line 91) | @Override
method notifyError (line 96) | @Override
method isSonicUrl (line 101) | @Override
method setCookie (line 106) | @Override
method isNetworkValid (line 118) | @Override
method postTaskToThread (line 123) | @Override
method getSonicCacheDir (line 129) | @Override
method getHostDirectAddress (line 142) | @Override
FILE: sonic-android/sample/src/main/java/com/tencent/sonic/demo/SonicSessionClientImpl.java
class SonicSessionClientImpl (line 27) | public class SonicSessionClientImpl extends SonicSessionClient {
method bindWebView (line 31) | public void bindWebView(WebView webView) {
method getWebView (line 35) | public WebView getWebView() {
method loadUrl (line 39) | @Override
method loadDataWithBaseUrl (line 44) | @Override
method loadDataWithBaseUrlAndHeader (line 50) | @Override
method destroy (line 55) | public void destroy() {
FILE: sonic-android/sample/src/main/java/com/tencent/sonic/demo/UrlListAdapter.java
class UrlListAdapter (line 33) | public class UrlListAdapter extends BaseAdapter {
method UrlListAdapter (line 49) | public UrlListAdapter(Context context) {
method init (line 55) | void init() {
method restore (line 60) | private void restore() {
method serialize (line 69) | private String serialize(ArrayList<String> stringArrayList) {
method deserialize (line 73) | private ArrayList<String> deserialize(String serializedString) {
method getCheckedUrl (line 80) | String getCheckedUrl() {
method addNewItem (line 84) | void addNewItem(String url) {
method toggleNormalMode (line 89) | void toggleNormalMode() {
method toggleEditMode (line 94) | void toggleEditMode() {
method setChecked (line 99) | void setChecked(int index) {
method getCount (line 106) | @Override
method getItem (line 111) | @Override
method getItemId (line 116) | @Override
method getView (line 121) | @Override
method persist (line 164) | void persist() {
class ViewHolder (line 171) | private class ViewHolder {
FILE: sonic-android/sample/src/main/java/com/tencent/sonic/demo/UrlSelector.java
class UrlSelector (line 35) | public class UrlSelector {
method launch (line 36) | static void launch(final Context context, final UrlListAdapter urlList...
type OnUrlChangedListener (line 130) | interface OnUrlChangedListener {
method urlChanged (line 131) | void urlChanged(String url);
FILE: sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/BaseSonicTest.java
class BaseSonicTest (line 44) | @RunWith(JUnit4.class)
method initSonicSession (line 59) | protected void initSonicSession() {
method setUp (line 78) | @Before
method tearDown (line 87) | @After
method desroySonicSession (line 92) | protected void desroySonicSession() throws InterruptedException {
method mockFirstLoadResponse (line 112) | protected MockResponse mockFirstLoadResponse() {
method mock304Response (line 131) | protected MockResponse mock304Response() {
method mockTemplateChangedResponse (line 151) | protected MockResponse mockTemplateChangedResponse() {
method mockDataUpdatedResponse (line 173) | protected MockResponse mockDataUpdatedResponse() {
method mockLoadUrl (line 206) | protected void mockLoadUrl() {
method mockInterceptRequest (line 215) | protected void mockInterceptRequest(String html) throws IOException {
method handleMessage (line 236) | @Override
FILE: sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/ExampleInstrumentedTest.java
class ExampleInstrumentedTest (line 30) | @RunWith(AndroidJUnit4.class)
method useAppContext (line 33) | @Test
FILE: sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/QuickSonicSessionTest.java
class QuickSonicSessionTest (line 33) | @RunWith(JUnit4.class)
method handleFlow_NotModified (line 36) | @Test
method handleFlow_DataUpdate (line 87) | @Test
method handleFlow_TemplateChange (line 167) | @Test
method handleFlow_HttpError (line 242) | @Test
method handleFlow_ServiceUnavailable (line 246) | @Test
method handleFlow_FirstLoad (line 250) | @Test
FILE: sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/SonicRuntimeImplTest.java
class SonicRuntimeImplTest (line 35) | public class SonicRuntimeImplTest extends SonicRuntime {
method SonicRuntimeImplTest (line 37) | public SonicRuntimeImplTest(Context context) {
method getUserAgent (line 45) | @Override
method getCurrentUserAccount (line 54) | @Override
method getCookie (line 59) | @Override
method log (line 65) | @Override
method createWebResourceResponse (line 79) | @Override
method showToast (line 88) | @Override
method notifyError (line 93) | @Override
method isSonicUrl (line 98) | @Override
method setCookie (line 103) | @Override
method isNetworkValid (line 115) | @Override
method postTaskToThread (line 120) | @Override
method getSonicCacheDir (line 126) | @Override
method getHostDirectAddress (line 131) | @Override
FILE: sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/SonicSessionClientImplTest.java
class SonicSessionClientImplTest (line 20) | public class SonicSessionClientImplTest extends SonicSessionClient{
method loadUrl (line 22) | @Override
method loadDataWithBaseUrl (line 27) | @Override
method loadDataWithBaseUrlAndHeader (line 33) | @Override
FILE: sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/SonicTestData.java
type SonicTestData (line 16) | public interface SonicTestData {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/QuickSonicSession.java
class QuickSonicSession (line 49) | public class QuickSonicSession extends SonicSession implements Handler.C...
method QuickSonicSession (line 144) | QuickSonicSession(String id, String url, SonicSessionConfig config) {
method handleMessage (line 148) | @Override
method handleClientCoreMessage_ConnectionError (line 207) | private void handleClientCoreMessage_ConnectionError(Message msg) {
method handleClientCoreMessage_ServiceUnavailable (line 222) | private void handleClientCoreMessage_ServiceUnavailable(Message msg) {
method handleClientCoreMessage_PreLoad (line 238) | private void handleClientCoreMessage_PreLoad(Message msg) {
method handleClientCoreMessage_FirstLoad (line 275) | private void handleClientCoreMessage_FirstLoad(Message msg) {
method handleClientCoreMessage_DataUpdate (line 311) | private void handleClientCoreMessage_DataUpdate(Message msg) {
method handleClientCoreMessage_TemplateChange (line 348) | private void handleClientCoreMessage_TemplateChange(Message msg) {
method handleFlow_LoadLocalCache (line 390) | @Override
method onWebReady (line 410) | public boolean onWebReady(SonicDiffDataCallback callback) {
method onClientReady (line 426) | public boolean onClientReady() {
method onRequestResource (line 441) | protected Object onRequestResource(String url) {
method handleFlow_HttpError (line 493) | protected void handleFlow_HttpError(int responseCode){
method handleFlow_ServiceUnavailable (line 508) | protected void handleFlow_ServiceUnavailable(){
method handleFlow_TemplateChange (line 530) | protected void handleFlow_TemplateChange(String newHtml) {
method handleFlow_FirstLoad (line 611) | protected void handleFlow_FirstLoad() {
method handleFlow_DataUpdate (line 655) | protected void handleFlow_DataUpdate(String serverRsp) {
method clearSessionData (line 770) | @Override
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicCacheInterceptor.java
class SonicCacheInterceptor (line 28) | public abstract class SonicCacheInterceptor {
method SonicCacheInterceptor (line 34) | public SonicCacheInterceptor(SonicCacheInterceptor next) {
method next (line 38) | public SonicCacheInterceptor next() {
method getCacheData (line 42) | public abstract String getCacheData(SonicSession session);
method getSonicCacheData (line 44) | static String getSonicCacheData(SonicSession session) {
class SonicCacheInterceptorDefaultImpl (line 64) | private static class SonicCacheInterceptorDefaultImpl {
method getCacheData (line 68) | public static String getCacheData(SonicSession session) {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicConfig.java
class SonicConfig (line 19) | public class SonicConfig {
method SonicConfig (line 76) | private SonicConfig() {
class Builder (line 83) | public static class Builder {
method Builder (line 87) | public Builder() {
method setMaxPreloadSessionCount (line 91) | public Builder setMaxPreloadSessionCount(int maxPreloadSessionCount) {
method setUnavailableTime (line 96) | public Builder setUnavailableTime(long unavailableTime) {
method setCacheVerifyWithSha1 (line 101) | public Builder setCacheVerifyWithSha1(boolean enable) {
method setCacheMaxSize (line 106) | public Builder setCacheMaxSize(long maxSize) {
method setResourceCacheMaxSize (line 111) | public Builder setResourceCacheMaxSize(long maxSize) {
method setCacheCheckTimeInterval (line 116) | public Builder setCacheCheckTimeInterval(long time) {
method setMaxNumOfDownloadingTasks (line 121) | public Builder setMaxNumOfDownloadingTasks(int num) {
method setAutoInitDBWhenCreate (line 126) | public Builder setAutoInitDBWhenCreate(boolean autoInitDBWhenCreate) {
method setGetCookieWhenSessionCreate (line 131) | public Builder setGetCookieWhenSessionCreate(boolean value) {
method setSonicCacheMaxAge (line 136) | public Builder setSonicCacheMaxAge(int maxAge) {
method build (line 141) | public SonicConfig build() {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicConstants.java
class SonicConstants (line 19) | public class SonicConstants {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicDBHelper.java
class SonicDBHelper (line 27) | public class SonicDBHelper extends SQLiteOpenHelper {
method SonicDBHelper (line 53) | private SonicDBHelper(Context context) {
method createInstance (line 57) | static synchronized SonicDBHelper createInstance(Context context) {
method getInstance (line 64) | public static synchronized SonicDBHelper getInstance() {
method onCreate (line 77) | @Override
method onUpgrade (line 88) | @Override
method doUpgrade (line 116) | private void doUpgrade(SQLiteDatabase db, int oldVersion, int newVersi...
method upgradeToVersion_2 (line 131) | private void upgradeToVersion_2(SQLiteDatabase db) {
method isUpgrading (line 140) | public boolean isUpgrading() {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicDataHelper.java
class SonicDataHelper (line 29) | class SonicDataHelper {
class SessionData (line 105) | static class SessionData {
method reset (line 153) | public void reset() {
method getAllSessionDataColumn (line 169) | static String[] getAllSessionDataColumn() {
method getSessionData (line 183) | @NonNull static SessionData getSessionData(String sessionId) {
method getSessionData (line 199) | private static SessionData getSessionData(SQLiteDatabase db, String se...
method querySessionData (line 220) | private static SessionData querySessionData(Cursor cursor) {
method getAllSessionByHitCount (line 238) | static List<SessionData> getAllSessionByHitCount() {
method saveSessionData (line 257) | static void saveSessionData(String sessionId, SessionData sessionData) {
method saveSessionData (line 269) | private static void saveSessionData(SQLiteDatabase db, String sessionI...
method insertSessionData (line 280) | private static void insertSessionData(SQLiteDatabase db, String sessio...
method updateSessionData (line 285) | private static void updateSessionData(SQLiteDatabase db, String sessio...
method getContentValues (line 291) | @NonNull
method removeSessionData (line 312) | static void removeSessionData(String sessionId) {
method setSonicUnavailableTime (line 325) | static boolean setSonicUnavailableTime(String sessionId, long unavaila...
method getLastSonicUnavailableTime (line 349) | static long getLastSonicUnavailableTime(String sessionId) {
method updateSonicCacheHitCount (line 358) | static void updateSonicCacheHitCount(String sessionId) {
method updateSonicCacheHitCount (line 369) | private static void updateSonicCacheHitCount(SQLiteDatabase db, String...
method clear (line 380) | static synchronized void clear() {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicDiffDataCallback.java
type SonicDiffDataCallback (line 21) | public interface SonicDiffDataCallback {
method callback (line 29) | void callback(String resultData);
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicEngine.java
class SonicEngine (line 29) | public class SonicEngine {
method SonicEngine (line 62) | private SonicEngine(SonicRuntime runtime, SonicConfig config) {
method getInstance (line 75) | public static synchronized SonicEngine getInstance() {
method isGetInstanceAllowed (line 88) | public static synchronized boolean isGetInstanceAllowed() {
method createInstance (line 98) | public static synchronized SonicEngine createInstance(@NonNull SonicRu...
method initSonicDB (line 112) | public void initSonicDB() {
method getRuntime (line 119) | public SonicRuntime getRuntime() {
method getConfig (line 126) | public SonicConfig getConfig() {
method isSonicAvailable (line 135) | public boolean isSonicAvailable() {
method makeSessionId (line 147) | public static String makeSessionId(String url, boolean isAccountRelate...
method preCreateSession (line 165) | public synchronized boolean preCreateSession(@NonNull String url, @Non...
method createSession (line 198) | public synchronized SonicSession createSession(@NonNull String url, @N...
method lookupSession (line 225) | private SonicSession lookupSession(SonicSessionConfig config, String s...
method internalCreateSession (line 257) | private SonicSession internalCreateSession(String sessionId, String ur...
method isSessionAvailable (line 283) | private boolean isSessionAvailable(String sessionId) {
method cleanCache (line 301) | public synchronized boolean cleanCache() {
method removeSessionCache (line 327) | public synchronized boolean removeSessionCache(@NonNull String session...
method trimSonicCache (line 348) | public void trimSonicCache() {
method onSessionStateChange (line 362) | @Override
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicFileUtils.java
class SonicFileUtils (line 35) | public class SonicFileUtils {
method getSonicCacheDirPath (line 78) | static String getSonicCacheDirPath() {
method getSonicResourceCachePath (line 91) | static String getSonicResourceCachePath() {
method getSonicTemplatePath (line 104) | static String getSonicTemplatePath(String sessionId) {
method getSonicDataPath (line 113) | static String getSonicDataPath(String sessionId) {
method getSonicHeaderPath (line 122) | static String getSonicHeaderPath(String sessionId) {
method getSonicHtmlPath (line 131) | static String getSonicHtmlPath(String sessionId) {
method getSonicResourcePath (line 140) | public static String getSonicResourcePath(String resourceName) {
method getSonicResourceHeaderPath (line 149) | public static String getSonicResourceHeaderPath(String resourceName) {
method deleteSonicFiles (line 158) | static boolean deleteSonicFiles(String sessionId) {
method deleteResourceFiles (line 188) | static boolean deleteResourceFiles(String resourceId) {
method verifyData (line 211) | static boolean verifyData(String content, String targetSha1) {
method verifyData (line 224) | public static boolean verifyData(byte[] content, String targetSha1) {
method readFile (line 234) | static String readFile(File file) {
method readFileToBytes (line 287) | public static byte[] readFileToBytes(File file) {
method writeFile (line 333) | static boolean writeFile(String str, String filePath) {
method writeFile (line 344) | static boolean writeFile(byte[] content, String filePath) {
method deleteAllChildFiles (line 374) | static boolean deleteAllChildFiles(File file) {
method checkAndTrimCache (line 396) | static void checkAndTrimCache() {
method checkAndTrimResourceCache (line 443) | static void checkAndTrimResourceCache() {
method calcCacheSize (line 485) | private static long calcCacheSize(String cacheDirPath, Map<String, Lis...
method convertHeadersToString (line 519) | static String convertHeadersToString(Map<String, List<String>> headers) {
method getHeaderFromLocalCache (line 547) | public static Map<String, List<String>> getHeaderFromLocalCache(String...
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicResourceDataHelper.java
class SonicResourceDataHelper (line 27) | public class SonicResourceDataHelper {
class ResourceData (line 79) | public static class ResourceData {
method reset (line 107) | public void reset() {
method getResourceData (line 121) | @NonNull
method getResourceData (line 138) | private static ResourceData getResourceData(SQLiteDatabase db, String ...
method getAllResourceDataColumn (line 159) | public static String[] getAllResourceDataColumn() {
method queryResourceData (line 173) | private static ResourceData queryResourceData(Cursor cursor) {
method saveResourceData (line 189) | static void saveResourceData(String resourceId, ResourceData resourceD...
method saveResourceData (line 201) | private static void saveResourceData(SQLiteDatabase db, String resourc...
method insertResourceData (line 211) | private static void insertResourceData(SQLiteDatabase db, String resou...
method updateResourceData (line 216) | private static void updateResourceData(SQLiteDatabase db, String resou...
method getAllResourceData (line 222) | static List<ResourceData> getAllResourceData() {
method getContentValues (line 233) | @NonNull
method removeResourceData (line 250) | static void removeResourceData(String resourceId) {
method clear (line 259) | static synchronized void clear() {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicRuntime.java
class SonicRuntime (line 40) | public abstract class SonicRuntime {
method SonicRuntime (line 57) | public SonicRuntime(Context context) {
method getContext (line 64) | public Context getContext() {
method makeSessionId (line 75) | public String makeSessionId(String url, boolean isAccountRelated) {
method getQueryParameterNames (line 124) | public Set<String> getQueryParameterNames(Uri uri) {
method shouldLog (line 165) | public boolean shouldLog(int level) {
method log (line 169) | public abstract void log(String tag, int level, String message);
method getCookie (line 178) | public abstract String getCookie(String url);
method setCookie (line 187) | public abstract boolean setCookie(String url, List<String> cookies);
method getUserAgent (line 195) | public abstract String getUserAgent();
method getSonicCacheDir (line 203) | public File getSonicCacheDir() {
method getSonicResourceCacheDir (line 219) | public File getSonicResourceCacheDir() {
method getSonicSharedPreferences (line 233) | public SharedPreferences getSonicSharedPreferences() {
method getCurrentUserAccount (line 243) | public abstract String getCurrentUserAccount();
method isSonicUrl (line 254) | public abstract boolean isSonicUrl(String url);
method createWebResourceResponse (line 274) | public abstract Object createWebResourceResponse(String mimeType, Stri...
method isNetworkValid (line 281) | public abstract boolean isNetworkValid();
method getHostDirectAddress (line 290) | public String getHostDirectAddress(String url) {
method showToast (line 300) | public abstract void showToast(CharSequence text, int duration);
method postTaskToThread (line 309) | public abstract void postTaskToThread(Runnable task, long delayMillis);
method postTaskToSessionThread (line 316) | public void postTaskToSessionThread(Runnable task) {
method postTaskToMainThread (line 326) | public void postTaskToMainThread(Runnable task, long delayMillis) {
method getFileThreadLooper (line 335) | public Looper getFileThreadLooper() {
method notifyError (line 351) | public abstract void notifyError(SonicSessionClient client, String url...
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicServer.java
class SonicServer (line 46) | public class SonicServer implements SonicSessionStream.Callback {
method SonicServer (line 73) | public SonicServer(SonicSession session, Intent requestIntent) {
method connect (line 86) | protected int connect() {
method isSonicResponse (line 189) | private boolean isSonicResponse() {
method isFirstLoadRequest (line 208) | private boolean isFirstLoadRequest() {
method getResponseCode (line 213) | public int getResponseCode() {
method disconnect (line 220) | public void disconnect() {
method getResponseHeaderFields (line 246) | public Map<String, List<String>> getResponseHeaderFields() {
method getResponseHeaderField (line 288) | public String getResponseHeaderField(String key) {
method getResponseStream (line 314) | public synchronized InputStream getResponseStream(AtomicBoolean breakC...
method addResponseHeaderFields (line 328) | private void addResponseHeaderFields(String key, String... args) {
method getResponseData (line 345) | public synchronized String getResponseData(boolean readUntilEnd) {
method getTemplate (line 356) | public synchronized String getTemplate() {
method getUpdatedData (line 367) | public synchronized String getUpdatedData() {
method readServerResponse (line 382) | private boolean readServerResponse(AtomicBoolean breakCondition) {
method separateTemplateAndData (line 410) | protected void separateTemplateAndData() {
method getCustomHeadFieldEtagKey (line 454) | public String getCustomHeadFieldEtagKey() {
method onClose (line 458) | @Override
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSession.java
class SonicSession (line 54) | public abstract class SonicSession implements Handler.Callback {
type Callback (line 394) | public interface Callback {
method onSessionStateChange (line 404) | void onSessionStateChange(SonicSession session, int oldState, int ne...
method handleMessage (line 410) | @Override
method saveSonicCacheOnServerClose (line 431) | private void saveSonicCacheOnServerClose(SonicServer sonicServer) {
method SonicSession (line 458) | SonicSession(String id, String url, SonicSessionConfig config) {
method start (line 504) | public void start() {
method runSonicFlow (line 531) | private void runSonicFlow(boolean firstRequest) {
method refresh (line 583) | public boolean refresh() {
method createConnectionIntent (line 619) | protected Intent createConnectionIntent(SonicDataHelper.SessionData se...
method handleFlow_Connection (line 659) | protected void handleFlow_Connection(boolean hasCache, SonicDataHelper...
method getSessionData (line 779) | @Nullable
method handleFlow_LoadLocalCache (line 804) | protected abstract void handleFlow_LoadLocalCache(String cacheHtml);
method handleFlow_FirstLoad (line 809) | protected abstract void handleFlow_FirstLoad();
method handleFlow_DataUpdate (line 816) | protected abstract void handleFlow_DataUpdate(String serverRsp);
method handleFlow_TemplateChange (line 822) | protected abstract void handleFlow_TemplateChange(String newHtml);
method handleFlow_HttpError (line 824) | protected abstract void handleFlow_HttpError(int responseCode);
method handleFlow_ServiceUnavailable (line 826) | protected abstract void handleFlow_ServiceUnavailable();
method handleFlow_NotModified (line 828) | protected void handleFlow_NotModified() {
method handleFlow_PreloadSubResource (line 845) | private void handleFlow_PreloadSubResource() {
method setIsPreload (line 862) | void setIsPreload(String url) {
method isPreload (line 870) | public boolean isPreload() {
method getStatistics (line 874) | public SonicSessionStatistics getStatistics() {
method addSessionStateChangedCallback (line 878) | protected boolean addSessionStateChangedCallback(Callback callback) {
method removeSessionStateChangedCallback (line 882) | protected boolean removeSessionStateChangedCallback(Callback callback) {
method addSessionCallback (line 887) | public boolean addSessionCallback(SonicSessionCallback callback) {
method removeSessionCallback (line 891) | public boolean removeSessionCallback(SonicSessionCallback callback) {
method getCurrentUrl (line 907) | public String getCurrentUrl() {
method getFinalResultCode (line 911) | public int getFinalResultCode() {
method getSrcResultCode (line 915) | public int getSrcResultCode() {
method isDestroyedOrWaitingForDestroy (line 919) | public boolean isDestroyedOrWaitingForDestroy() {
method postForceDestroyIfNeed (line 928) | protected boolean postForceDestroyIfNeed() {
method canDestroy (line 936) | protected boolean canDestroy() {
method switchState (line 944) | protected boolean switchState(int fromState, int toState, boolean noti...
method onServerClosed (line 969) | public void onServerClosed(final SonicServer sonicServer, final boolea...
method postTaskToSaveSonicCache (line 1011) | protected void postTaskToSaveSonicCache(final String htmlString) {
method doSaveSonicCache (line 1019) | protected void doSaveSonicCache(SonicServer sonicServer, String htmlSt...
method notifyStateChange (line 1069) | protected void notifyStateChange(int oldState, int newState, Bundle ex...
method setResult (line 1086) | protected void setResult(int srcCode, int finalCode, boolean notify) {
method bindClient (line 1187) | public boolean bindClient(SonicSessionClient client) {
method onClientReady (line 1203) | public boolean onClientReady() {
method onClientRequestResource (line 1213) | public final Object onClientRequestResource(String url) {
method shouldSetCookieAsynchronous (line 1239) | protected boolean shouldSetCookieAsynchronous() {
method setCookiesFromHeaders (line 1250) | protected boolean setCookiesFromHeaders(Map<String, List<String>> head...
method onRequestResource (line 1277) | protected Object onRequestResource(String url) {
method onWebReady (line 1289) | public boolean onWebReady(SonicDiffDataCallback diffDataCallback) {
method onClientPageFinished (line 1293) | public boolean onClientPageFinished(String url) {
method isMatchCurrentUrl (line 1309) | public boolean isMatchCurrentUrl(String url) {
method getHeaders (line 1333) | protected HashMap<String, String> getHeaders() {
method getCharsetFromHeaders (line 1344) | protected String getCharsetFromHeaders() {
method getCharsetFromHeaders (line 1349) | public String getCharsetFromHeaders(Map<String, String> headers) {
method getCacheHeaders (line 1366) | protected HashMap<String, String> getCacheHeaders() {
method getSessionClient (line 1371) | public SonicSessionClient getSessionClient() {
method getCustomHeadFieldEtagKey (line 1375) | protected String getCustomHeadFieldEtagKey() {
method destroy (line 1379) | public void destroy() {
method destroy (line 1383) | protected void destroy(boolean force) {
method clearSessionData (line 1444) | protected void clearSessionData() {
method checkAndClearCacheData (line 1451) | private void checkAndClearCacheData() {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionCallback.java
type SonicSessionCallback (line 19) | interface SonicSessionCallback {
method onSessionLoadLocalCache (line 24) | void onSessionLoadLocalCache(String cacheHtml);
method onSessionDataUpdated (line 30) | void onSessionDataUpdated(String serverRsp);
method onSessionFirstLoad (line 36) | void onSessionFirstLoad(String html);
method onSessionHttpError (line 42) | void onSessionHttpError(int responseCode);
method onSessionHitCache (line 47) | void onSessionHitCache();
method onSessionUnAvailable (line 52) | void onSessionUnAvailable();
method onSessionTemplateChanged (line 58) | void onSessionTemplateChanged(String newHtml);
method onSessionSaveCache (line 67) | void onSessionSaveCache(String htmlString, String templateString, Stri...
method onSonicSessionStart (line 72) | void onSonicSessionStart() ;
method onSessionDestroy (line 77) | void onSessionDestroy();
method onSonicSessionRefresh (line 82) | void onSonicSessionRefresh();
class SimpleCallbackImpl (line 87) | public class SimpleCallbackImpl implements SonicSessionCallback {
method onSessionLoadLocalCache (line 89) | @Override
method onSessionDataUpdated (line 94) | @Override
method onSessionFirstLoad (line 99) | @Override
method onSessionHttpError (line 104) | @Override
method onSessionHitCache (line 109) | @Override
method onSessionUnAvailable (line 114) | @Override
method onSessionTemplateChanged (line 119) | @Override
method onSessionSaveCache (line 124) | @Override
method onSonicSessionStart (line 129) | @Override
method onSessionDestroy (line 134) | @Override
method onSonicSessionRefresh (line 139) | @Override
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionClient.java
class SonicSessionClient (line 25) | public abstract class SonicSessionClient {
method clientReady (line 35) | public void clientReady() {
method requestResource (line 49) | public Object requestResource(String url) {
method getDiffData (line 61) | public void getDiffData(SonicDiffDataCallback callback) {
method pageFinish (line 73) | public void pageFinish(String url) {
method bindSession (line 84) | public void bindSession(SonicSession session) {
method loadUrl (line 94) | public abstract void loadUrl(String url, Bundle extraData);
method loadDataWithBaseUrl (line 109) | public abstract void loadDataWithBaseUrl(String baseUrl, String data, ...
method loadDataWithBaseUrlAndHeader (line 124) | public abstract void loadDataWithBaseUrlAndHeader(String baseUrl, Stri...
method clearHistory (line 132) | public void clearHistory() {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionConfig.java
class SonicSessionConfig (line 25) | public class SonicSessionConfig {
method equals (line 110) | @Override
method SonicSessionConfig (line 121) | private SonicSessionConfig() {
class Builder (line 128) | public static class Builder {
method Builder (line 132) | public Builder() {
method setConnectTimeoutMillis (line 136) | public Builder setConnectTimeoutMillis(int connectTimeoutMillis) {
method setReadTimeoutMillis (line 141) | public Builder setReadTimeoutMillis(int readTimeoutMillis) {
method setReadBufferSize (line 146) | public Builder setReadBufferSize(int readBufferSize) {
method setPreloadSessionExpiredTimeMillis (line 151) | public Builder setPreloadSessionExpiredTimeMillis(long preloadSessio...
method setAcceptDiff (line 156) | public Builder setAcceptDiff(boolean enable) {
method setIsAccountRelated (line 161) | public Builder setIsAccountRelated(boolean value) {
method setReloadInBadNetwork (line 166) | public Builder setReloadInBadNetwork(boolean reloadInBadNetwork) {
method setAutoStartWhenCreate (line 171) | public Builder setAutoStartWhenCreate(boolean autoStartWhenCreate) {
method setUseSonicCacheInBadNetworkToastMessage (line 176) | public Builder setUseSonicCacheInBadNetworkToastMessage(String toast...
method setSessionMode (line 181) | public Builder setSessionMode(int sessionMode) {
method setCacheInterceptor (line 186) | public Builder setCacheInterceptor(SonicCacheInterceptor interceptor) {
method setConnectionInterceptor (line 191) | public Builder setConnectionInterceptor(SonicSessionConnectionInterc...
method setCustomRequestHeaders (line 196) | public Builder setCustomRequestHeaders(Map<String, String> customReq...
method setCustomResponseHeaders (line 201) | public Builder setCustomResponseHeaders(Map<String, String> customRe...
method setSupportCacheControl (line 206) | public Builder setSupportCacheControl(boolean supportCacheControl) {
method setSupportLocalServer (line 211) | public Builder setSupportLocalServer(boolean enable) {
method build (line 217) | public SonicSessionConfig build() {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionConnection.java
class SonicSessionConnection (line 44) | public abstract class SonicSessionConnection {
method SonicSessionConnection (line 196) | public SonicSessionConnection(SonicSession session, Intent intent) {
method connect (line 207) | public synchronized int connect() {
method disconnect (line 215) | public abstract void disconnect();
method getResponseCode (line 218) | public abstract int getResponseCode();
method getResponseHeaderFields (line 220) | public abstract Map<String, List<String>> getResponseHeaderFields();
method getResponseHeaderField (line 227) | public abstract String getResponseHeaderField(String key);
method getResponseStream (line 233) | public synchronized BufferedInputStream getResponseStream() {
method internalConnect (line 241) | protected abstract int internalConnect();
method internalGetResponseStream (line 243) | protected abstract BufferedInputStream internalGetResponseStream();
method getCustomHeadFieldEtagKey (line 245) | public String getCustomHeadFieldEtagKey() {
method internalGetCustomHeadFieldEtag (line 252) | protected abstract String internalGetCustomHeadFieldEtag();
class SessionConnectionDefaultImpl (line 255) | public static class SessionConnectionDefaultImpl extends SonicSessionC...
method SessionConnectionDefaultImpl (line 264) | public SessionConnectionDefaultImpl(SonicSession session, Intent int...
method createConnection (line 270) | protected URLConnection createConnection() {
method initConnection (line 338) | protected boolean initConnection(URLConnection connection) {
method internalConnect (line 384) | @Override
method disconnect (line 414) | @Override
method internalGetResponseStream (line 439) | @Override
method getResponseCode (line 456) | @Override
method getResponseHeaderFields (line 486) | @Override
method getResponseHeaderField (line 500) | @Override
method internalGetCustomHeadFieldEtag (line 517) | @Override
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionConnectionInterceptor.java
class SonicSessionConnectionInterceptor (line 25) | public abstract class SonicSessionConnectionInterceptor {
method getConnection (line 27) | public abstract SonicSessionConnection getConnection(SonicSession sess...
method getSonicSessionConnection (line 29) | public static SonicSessionConnection getSonicSessionConnection(SonicSe...
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionStatistics.java
class SonicSessionStatistics (line 23) | public class SonicSessionStatistics {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionStream.java
class SonicSessionStream (line 33) | public class SonicSessionStream extends InputStream {
type Callback (line 68) | public interface Callback {
method onClose (line 75) | void onClose(boolean readComplete, ByteArrayOutputStream outputStream);
method SonicSessionStream (line 90) | public SonicSessionStream(Callback callback, ByteArrayOutputStream out...
method close (line 112) | @Override
method read (line 167) | @Override
method read (line 204) | @Override
method read (line 219) | public synchronized int read(@NonNull byte[] buffer, int byteOffset, i...
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionThreadPool.java
class SonicSessionThreadPool (line 30) | class SonicSessionThreadPool {
class SessionThreadFactory (line 50) | private static class SessionThreadFactory implements ThreadFactory {
method SessionThreadFactory (line 70) | SessionThreadFactory() {
method newThread (line 83) | public Thread newThread(@NonNull Runnable r) {
method SonicSessionThreadPool (line 102) | private SonicSessionThreadPool() {
method execute (line 117) | private boolean execute(Runnable task) {
method postTask (line 134) | static boolean postTask(Runnable task) {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSniSSLSocketFactory.java
class SonicSniSSLSocketFactory (line 41) | class SonicSniSSLSocketFactory extends SSLSocketFactory {
method SonicSniSSLSocketFactory (line 58) | SonicSniSSLSocketFactory(Context context, String targetHostName) {
method getDefaultCipherSuites (line 69) | @Override
method getSupportedCipherSuites (line 80) | @Override
method createSocket (line 90) | @Override
method createSocket (line 101) | @Override
method createSocket (line 117) | @Override
method createSocket (line 127) | @Override
method createSocket (line 143) | @Override
method createSocket (line 154) | @Override
method verifyHostname (line 175) | public static void verifyHostname(Socket socket, String hostname) thro...
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicUtils.java
class SonicUtils (line 43) | public class SonicUtils {
method shouldLog (line 107) | public static boolean shouldLog(int level) {
method log (line 119) | public static void log(String tag, int level, String message) {
method saveSonicData (line 132) | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
method handleCacheControl (line 154) | private static void handleCacheControl(Map<String, List<String>> heade...
method saveSonicResourceData (line 208) | public static void saveSonicResourceData(String resourceUrl, String re...
method handleResourceExpireTime (line 227) | private static void handleResourceExpireTime(String resourceUrl, Sonic...
method getDiffData (line 251) | static JSONObject getDiffData(String sessionId, JSONObject serverDataJ...
method getDiffData (line 271) | static JSONObject getDiffData(JSONObject localDataJson, JSONObject ser...
method buildHtml (line 301) | static String buildHtml(final String sessionId, JSONObject dataJson, S...
method buildHtml (line 339) | static String buildHtml(String templateString, JSONObject dataJson, in...
method saveSessionFiles (line 369) | static boolean saveSessionFiles(String sessionId, String htmlString, S...
method saveResourceFiles (line 401) | public static boolean saveResourceFiles(String resourceName, byte[] re...
method getFilteredHeaders (line 422) | public static HashMap<String, String> getFilteredHeaders(Map<String, L...
method getCharset (line 450) | static String getCharset(String headerValue) {
method separateTemplateAndData (line 477) | static boolean separateTemplateAndData(String sessionId, String htmlSt...
method removeSessionCache (line 538) | static void removeSessionCache(String sessionId) {
method removeResourceCache (line 548) | public static void removeResourceCache(String resourceId) {
method removeAllSessionCache (line 557) | static boolean removeAllSessionCache() {
method needSaveData (line 575) | static boolean needSaveData(boolean isSupportCacheControl, String cach...
method needRefreshPage (line 601) | static boolean needRefreshPage(String cacheOffline) {
method addSonicUrlParam (line 606) | static String addSonicUrlParam(String url, String paramKey, String par...
method getMime (line 655) | public static String getMime(String url) {
method getSHA1 (line 676) | static String getSHA1(String content) {
method getSHA1 (line 683) | public static String getSHA1(byte[] contentBytes) {
method getMD5 (line 697) | public static String getMD5(String content) {
method toHexString (line 709) | private static String toHexString(byte b[]) {
method shouldClearCache (line 723) | static boolean shouldClearCache(long timeInterval) {
method saveClearCacheTime (line 734) | static void saveClearCacheTime(long timestamp) {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/StandardSonicSession.java
class StandardSonicSession (line 42) | public class StandardSonicSession extends SonicSession implements Handle...
method StandardSonicSession (line 65) | StandardSonicSession(String id, String url, SonicSessionConfig config) {
method getSrcResultCode (line 69) | public int getSrcResultCode() {
method handleMessage (line 74) | @Override
method onClientReady (line 119) | public boolean onClientReady() {
method onWebReady (line 132) | public boolean onWebReady(SonicDiffDataCallback callback) {
method onRequestResource (line 148) | protected Object onRequestResource(String url) {
method handleFlow_LoadLocalCache (line 200) | @Override
method handleFlow_TemplateChange (line 234) | @Override
method handleFlow_HttpError (line 309) | @Override
method handleFlow_ServiceUnavailable (line 319) | @Override
method handleFlow_FirstLoad (line 341) | protected void handleFlow_FirstLoad() {
method handleFlow_DataUpdate (line 404) | protected void handleFlow_DataUpdate(String serverRsp) {
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadCache.java
class SonicDownloadCache (line 35) | public abstract class SonicDownloadCache {
method getResourceCache (line 43) | public abstract byte[] getResourceCache(String url);
method getResourceCacheHeader (line 51) | public abstract Map<String, List<String>> getResourceCacheHeader(Strin...
method getSubResourceCache (line 57) | public static SonicDownloadCache getSubResourceCache() {
class SonicResourceCache (line 64) | public static class SonicResourceCache extends SonicDownloadCache {
method getResourceCache (line 71) | public byte[] getResourceCache(String resourceUrl) {
method getResourceCacheHeader (line 124) | public Map<String, List<String>> getResourceCacheHeader(String resou...
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadCallback.java
type SonicDownloadCallback (line 25) | public interface SonicDownloadCallback {
method onStart (line 29) | void onStart();
method onProgress (line 37) | void onProgress(int pro, int total);
method onSuccess (line 45) | void onSuccess(byte[] content, Map<String, List<String>> rspHeaders);
method onError (line 52) | void onError(int errorCode);
method onFinish (line 57) | void onFinish();
class SimpleDownloadCallback (line 62) | class SimpleDownloadCallback implements SonicDownloadCallback {
method onStart (line 64) | @Override
method onProgress (line 67) | @Override
method onSuccess (line 70) | @Override
method onError (line 73) | @Override
method onFinish (line 76) | @Override
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadClient.java
class SonicDownloadClient (line 46) | public class SonicDownloadClient implements SonicSessionStream.Callback {
class DownloadTask (line 61) | public static class DownloadTask {
method SonicDownloadClient (line 146) | public SonicDownloadClient(DownloadTask task) {
method download (line 157) | public int download() {
method readServerResponse (line 180) | private boolean readServerResponse(AtomicBoolean breakCondition) {
method getResponseStream (line 212) | private synchronized boolean getResponseStream(AtomicBoolean breakCond...
method onClose (line 230) | @Override
method onStart (line 238) | private void onStart() {
method onProgress (line 246) | private void onProgress(int pro, int total) {
method onSuccess (line 254) | private void onSuccess(byte[] content, Map<String, List<String>> rspHe...
method onError (line 263) | private void onError(int errCode) {
method onFinish (line 272) | private void onFinish() {
class SonicDownloadConnection (line 281) | public class SonicDownloadConnection {
method SonicDownloadConnection (line 288) | public SonicDownloadConnection(String url) {
method createConnection (line 294) | URLConnection createConnection() {
method initConnection (line 325) | boolean initConnection(URLConnection connection) {
method connect (line 342) | synchronized int connect() {
method disconnect (line 355) | public void disconnect() {
method getResponseStream (line 366) | BufferedInputStream getResponseStream() {
method getResponseCode (line 382) | int getResponseCode() {
method getResponseHeaderFields (line 395) | Map<String, List<String>> getResponseHeaderFields() {
class SubResourceDownloadCallback (line 406) | public static class SubResourceDownloadCallback extends SonicDownloadC...
method SubResourceDownloadCallback (line 410) | public SubResourceDownloadCallback(String url) {
method onStart (line 414) | @Override
method onSuccess (line 421) | @Override
method onError (line 431) | @Override
FILE: sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadEngine.java
class SonicDownloadEngine (line 43) | public class SonicDownloadEngine implements Handler.Callback {
class SonicDownloadQueue (line 68) | private static class SonicDownloadQueue
method dequeue (line 71) | synchronized DownloadTask dequeue() {
method enqueue (line 79) | synchronized void enqueue(DownloadTask task) {
method SonicDownloadEngine (line 110) | public SonicDownloadEngine(SonicDownloadCache cache) {
method handleMessage (line 120) | @Override
method download (line 155) | public DownloadTask download(String resourceUrl, String ipAddress, Str...
method startDownload (line 205) | private void startDownload(final DownloadTask task) {
method onRequestSubResource (line 224) | public Object onRequestSubResource(String url, SonicSession session) {
method addSubResourcePreloadTask (line 274) | public void addSubResourcePreloadTask(List<String> preloadLinks) {
FILE: sonic-iOS/Sonic/SonicConstants.h
type SonicURLProtocolActionLoadData (line 53) | typedef NS_ENUM(NSUInteger, SonicURLProtocolAction) {
FILE: sonic-iOS/Sonic/Statistics/SonicEventConstants.h
type SonicStatisticsEvent_EventLog (line 26) | typedef NS_ENUM(NSUInteger, SonicStatisticsEvent) {
FILE: sonic-java/apidocs/script.js
function show (line 1) | function show(type)
function updateTabs (line 16) | function updateTabs(type)
FILE: sonic-java/src/main/java/com/github/tencent/AbstractReplaceCallBack.java
class AbstractReplaceCallBack (line 5) | public abstract class AbstractReplaceCallBack implements ReplaceCallBack {
method replace (line 9) | final public String replace(String text, int index, Matcher matcher) {
method doReplace (line 25) | public abstract String doReplace(String text, int index, Matcher match...
FILE: sonic-java/src/main/java/com/github/tencent/HttpServletResponseCopier.java
class HttpServletResponseCopier (line 11) | public class HttpServletResponseCopier extends HttpServletResponseWrapper {
method HttpServletResponseCopier (line 15) | public HttpServletResponseCopier(HttpServletResponse response) throws ...
method getOutputStream (line 19) | @Override
method getWriter (line 28) | @Override
method flushBuffer (line 40) | @Override
method getCopy (line 49) | public byte[] getCopy() {
FILE: sonic-java/src/main/java/com/github/tencent/ReplaceCallBack.java
type ReplaceCallBack (line 5) | public interface ReplaceCallBack {
method replace (line 13) | public String replace(String text, int index, Matcher matcher);
FILE: sonic-java/src/main/java/com/github/tencent/ServletOutputStreamCopier.java
class ServletOutputStreamCopier (line 9) | public class ServletOutputStreamCopier extends ServletOutputStream {
method ServletOutputStreamCopier (line 13) | public ServletOutputStreamCopier() {
method write (line 17) | @Override
method getCopy (line 22) | public byte[] getCopy() {
method isReady (line 26) | @Override
method setWriteListener (line 31) | @Override
FILE: sonic-java/src/main/java/com/github/tencent/SonicFilter.java
class TemplateReplace (line 20) | class TemplateReplace extends AbstractReplaceCallBack {
method doReplace (line 26) | public String doReplace(String text, int index, Matcher matcher) {
method reset (line 42) | public static void reset() {
class SonicFilter (line 50) | public class SonicFilter implements Filter {
method destroy (line 54) | @Override
method doFilter (line 59) | @Override
method init (line 151) | @Override
FILE: sonic-java/src/main/java/com/github/tencent/SonicUtil.java
class SonicUtil (line 13) | public class SonicUtil {
method hex (line 21) | public static String hex(byte[] arr) {
method encrypt (line 35) | public static String encrypt(String inputText, String algorithmName) {
method replaceAllCallBack (line 63) | public static String replaceAllCallBack(String string, Pattern pattern...
method pregMatch (line 89) | public static String pregMatch(String strContent, String strPattern) {
method getAllHttpHeaders (line 103) | public static Map<String,String> getAllHttpHeaders(HttpServletRequest ...
FILE: sonic-nodejs/assets/build/gulpfile.js
function buildEjs2js (line 44) | function buildEjs2js(src, dest, callback) {
function modify (line 78) | function modify(fn) {
function lf2crlf (line 94) | function lf2crlf() {
FILE: sonic-nodejs/middleware/compress.js
function getDiff (line 58) | function getDiff() {
FILE: sonic-php/sample/controller/demo.php
class controller_demo (line 13) | class controller_demo
method actionIndex (line 15) | public function actionIndex(){
FILE: sonic-php/sample/index.php
function getallheaders (line 10) | function getallheaders()
FILE: sonic-php/sample/js/sonic-3.js
function getSonicData (line 14) | function getSonicData(callback) {
FILE: sonic-php/sample/util/sonic.php
function getallheaders (line 16) | function getallheaders()
class TemplateReplace (line 30) | class TemplateReplace{
method callback (line 36) | public function callback($matches) {
class util_sonic (line 50) | class util_sonic {
method start (line 51) | public static function start(){
method end (line 56) | public static function end() {
method wnsHtmlDiffDivision (line 91) | public static function wnsHtmlDiffDivision($htmlStr){
FILE: sonic-php/sdk/sonic.php
function getallheaders (line 15) | function getallheaders()
class TemplateReplace (line 29) | class TemplateReplace{
method callback (line 35) | public function callback($matches) {
class util_sonic (line 49) | class util_sonic {
method start (line 50) | public static function start(){
method end (line 55) | public static function end() {
method wnsHtmlDiffDivision (line 90) | public static function wnsHtmlDiffDivision($htmlStr){
FILE: sonic-react/components/GameArea.js
class GameArea (line 12) | class GameArea extends React.Component {
method handleClickImg (line 13) | handleClickImg(index, i) {
method render (line 17) | render() {
FILE: sonic-react/components/GameHeader.js
class GameHeader (line 13) | class GameHeader extends React.Component {
method render (line 14) | render() {
FILE: sonic-react/containers/GameContainer.js
class GameContainer (line 17) | class GameContainer extends React.Component {
method constructor (line 18) | constructor(props) {
method componentWillReceiveProps (line 27) | componentWillReceiveProps(nextProps) {
method handleClickImg (line 36) | handleClickImg(index, i) {
method render (line 70) | render() {
FILE: sonic-react/pages/demo.js
class App (line 17) | class App extends React.Component {
method getInitialProps (line 18) | static async getInitialProps({ store }) {
method componentDidMount (line 22) | componentDidMount() {
method getSonicData (line 49) | getSonicData(callback) {
method render (line 102) | render() {
FILE: sonic-react/server.js
function formatHtml (line 46) | function formatHtml(html) {
FILE: sonic-react/static/js/flexible.js
function c (line 1) | function c(){var b=f.getBoundingClientRect().width;b/i>540&&(b=540*i);va...
Condensed preview — 288 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,326K chars).
[
{
"path": ".gitignore",
"chars": 42,
"preview": "# MacOS\n.DS_Store\n\n# Windows\n*.txt\n.idea/\n"
},
{
"path": "CONTRIBUTING.md",
"chars": 2394,
"preview": "# Contributing to VasSonic\nWelcome to [report Issues](https://github.com/Tencent/VasSonic/issues) or [pull requests](htt"
},
{
"path": "ISSUE_TEMPLATE",
"chars": 307,
"preview": "What steps will reproduce the problem? \n该问题的重现步骤是什么?\n1. \n2. \n3. \n\n\nWhat is the expected output? What do you see instead?"
},
{
"path": "LICENSE",
"chars": 13069,
"preview": "Tencent is pleased to support the open source community by making VasSonic available. \nCopyright (C) 2017 THL A29 Limit"
},
{
"path": "README.md",
"chars": 5048,
"preview": "## VasSonic: A Lightweight And High-performance Hybrid Framework\n[,在该模式下无需后台配合亦可完成秒开;\n* 支持自定义请求头和自定义响应头;\n* 支持Cache-Control来控制缓存生命周期;\n"
},
{
"path": "assets/VasSonic3.0_preload.md",
"chars": 2126,
"preview": "# Sonic 3.0 子资源预下载功能特性介绍\n\n## 1 子资源预下载\n\nVasSonic中子资源预下载功能的灵感就来源于Chrome中的\\<link rel='preload'/>。\n> \\<link rel='preload'/>:"
},
{
"path": "assets/sonic发展历程.md",
"chars": 11391,
"preview": "# VasSonic成长历程\n## 1.前言\n2017年8月8日,腾讯SNG增值产品部技术团队(以下简称VAS)研发的轻量级高性能Hybrid框架VasSonic通过了公司最终审核,作为腾讯开源组件的一份子分享给大家。从当初立项优化页面加载"
},
{
"path": "checkstyle.xml",
"chars": 5566,
"preview": "<?xml version=\"1.0\"?>\n<!--\n Copyright (C) 2016 THL A29 Limited, a Tencent company.\n Copyright (C) 2014 Square, Inc.\n\n "
},
{
"path": "sonic-android/.gitignore",
"chars": 544,
"preview": ".gradle\n/build\n# Ignore Gradle GUI config\ngradle-app.setting\n\n# Avoid ignoring Gradle wrapper jar file (.jar files are u"
},
{
"path": "sonic-android/README.md",
"chars": 7618,
"preview": "## Getting started with Android\n[](https:"
},
{
"path": "sonic-android/build.gradle",
"chars": 642,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n r"
},
{
"path": "sonic-android/docs/Sonic Quick模式实现原理.md",
"chars": 4837,
"preview": "# Sonic Quick模式实现原理\n\n---\n根据本地是否有缓存数据可以将Quick模式下的sonic分为无缓存和有缓存模式。对于有缓存模式又可以分为完全缓存、局部刷新和全局刷新(也就是模版变更),下面就看下这几种模式的执行流程。\n\n无"
},
{
"path": "sonic-android/docs/Sonic Standard模式实现原理.md",
"chars": 3899,
"preview": "# Sonic Standard模式实现原理\n---\n从前面介绍的sonic的基本原理可以知道,sonic分为Quick模式和Standard模式。本文介绍Standard模式的基本实现原理。\n根据本地缓存的数据情况可以将Quick模式下的"
},
{
"path": "sonic-android/docs/Sonic接入指引.md",
"chars": 8152,
"preview": "# 终端接入指引-Android版本\n----\n## 1.Sdk引入配置\n在模块的build.gradle文件里面加入\n\n```\ncompile 'com.tencent.sonic:sdk:3.0.0-alpha'\n```\n\n## 2.代"
},
{
"path": "sonic-android/docs/Sonic框架介绍.md",
"chars": 1125,
"preview": "# Sonic框架介绍\n\n\n\n---\n本文主要介绍sonic的整个框架设置,包括这个框架的类图结构以及各个类的主要职责介绍。\n\t\nsonicSdk类图结构:\n<img src = \"sonic.png\">\n\n\nsonic类职责说明:\n\nSo"
},
{
"path": "sonic-android/docs/javadoc/allclasses-frame.html",
"chars": 5911,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/allclasses-noframe.html",
"chars": 5231,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/QuickSonicSession.html",
"chars": 36480,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicCacheInterceptor.html",
"chars": 11835,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicConfig.Builder.html",
"chars": 16662,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicConfig.html",
"chars": 8976,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicConstants.html",
"chars": 22655,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicDBHelper.html",
"chars": 11000,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicDiffDataCallback.html",
"chars": 7522,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicEngine.html",
"chars": 23376,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicFileUtils.html",
"chars": 12824,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicResourceDataHelper.ResourceData.html",
"chars": 11347,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicResourceDataHelper.html",
"chars": 12466,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicRuntime.html",
"chars": 32197,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicServer.html",
"chars": 26278,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSession.Callback.html",
"chars": 8331,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSession.html",
"chars": 92091,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionClient.html",
"chars": 19750,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionConfig.Builder.html",
"chars": 23289,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionConfig.html",
"chars": 8653,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionConnection.SessionConnectionDefaultImpl.html",
"chars": 23134,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionConnection.html",
"chars": 36527,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionConnectionInterceptor.html",
"chars": 11751,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionStatistics.html",
"chars": 15729,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionStream.Callback.html",
"chars": 8144,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionStream.html",
"chars": 15618,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicUtils.html",
"chars": 17886,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/StandardSonicSession.html",
"chars": 35706,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadCache.SonicResourceCache.html",
"chars": 15333,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadCache.html",
"chars": 12432,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadCallback.SimpleDownloadCallback.html",
"chars": 16957,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadCallback.html",
"chars": 11842,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadClient.DownloadTask.html",
"chars": 17660,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadClient.SonicDownloadConnection.html",
"chars": 9346,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadClient.SubResourceDownloadCallback.html",
"chars": 16477,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadClient.html",
"chars": 14606,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/SonicDownloadEngine.html",
"chars": 15810,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/package-frame.html",
"chars": 2044,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/package-summary.html",
"chars": 7278,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/download/package-tree.html",
"chars": 6920,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/package-frame.html",
"chars": 4070,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/package-summary.html",
"chars": 12574,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/com/tencent/sonic/sdk/package-tree.html",
"chars": 9940,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/constant-values.html",
"chars": 40254,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/deprecated-list.html",
"chars": 3310,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/help-doc.html",
"chars": 5720,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/index-all.html",
"chars": 169368,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/index.html",
"chars": 2698,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">\n<!-- NewPage -->\n<"
},
{
"path": "sonic-android/docs/javadoc/overview-frame.html",
"chars": 904,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/overview-summary.html",
"chars": 3924,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/overview-tree.html",
"chars": 11866,
"preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n"
},
{
"path": "sonic-android/docs/javadoc/package-list",
"chars": 53,
"preview": "com.tencent.sonic.sdk\ncom.tencent.sonic.sdk.download\n"
},
{
"path": "sonic-android/docs/javadoc/script.js",
"chars": 827,
"preview": "function show(type)\n{\n count = 0;\n for (var key in methods) {\n var row = document.getElementById(key);\n "
},
{
"path": "sonic-android/docs/javadoc/stylesheet.css",
"chars": 12842,
"preview": "/* Javadoc style sheet */\n/*\nOverall document style\n*/\n\n@import url('resources/fonts/dejavu.css');\n\nbody {\n backgroun"
},
{
"path": "sonic-android/gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Mon Jun 19 17:11:15 CST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "sonic-android/gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "sonic-android/gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "sonic-android/sample/.gitignore",
"chars": 544,
"preview": ".gradle\n/build\n# Ignore Gradle GUI config\ngradle-app.setting\n\n# Avoid ignoring Gradle wrapper jar file (.jar files are u"
},
{
"path": "sonic-android/sample/build.gradle",
"chars": 1145,
"preview": "apply plugin: 'com.android.application'\n\nandroid {\n compileSdkVersion 25\n buildToolsVersion \"25.0.2\"\n defaultCo"
},
{
"path": "sonic-android/sample/proguard-rules.pro",
"chars": 940,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
},
{
"path": "sonic-android/sample/src/main/AndroidManifest.xml",
"chars": 993,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package="
},
{
"path": "sonic-android/sample/src/main/assets/sonic-demo-index.html",
"chars": 10411,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width"
},
{
"path": "sonic-android/sample/src/main/java/com/tencent/sonic/demo/BrowserActivity.java",
"chars": 10073,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sample/src/main/java/com/tencent/sonic/demo/MainActivity.java",
"chars": 6502,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sample/src/main/java/com/tencent/sonic/demo/SonicJavaScriptInterface.java",
"chars": 4592,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sample/src/main/java/com/tencent/sonic/demo/SonicRuntimeImpl.java",
"chars": 4237,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sample/src/main/java/com/tencent/sonic/demo/SonicSessionClientImpl.java",
"chars": 1952,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sample/src/main/java/com/tencent/sonic/demo/UrlListAdapter.java",
"chars": 5380,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sample/src/main/java/com/tencent/sonic/demo/UrlSelector.java",
"chars": 5621,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sample/src/main/res/drawable/ic_add_circle_accent_24dp.xml",
"chars": 397,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "sonic-android/sample/src/main/res/drawable/ic_add_circle_black_24dp.xml",
"chars": 399,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "sonic-android/sample/src/main/res/drawable/ic_add_circle_selector.xml",
"chars": 287,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item a"
},
{
"path": "sonic-android/sample/src/main/res/drawable/ic_remove_circle_accent_24dp.xml",
"chars": 376,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "sonic-android/sample/src/main/res/drawable/sonic_button_round_mask.xml",
"chars": 224,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<shape\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android"
},
{
"path": "sonic-android/sample/src/main/res/layout/activity_browser.xml",
"chars": 869,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.widget.FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/and"
},
{
"path": "sonic-android/sample/src/main/res/layout/activity_main.xml",
"chars": 3795,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.design.widget.CoordinatorLayout xmlns:android=\"http://schemas.an"
},
{
"path": "sonic-android/sample/src/main/res/layout/dialog_url.xml",
"chars": 1604,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "sonic-android/sample/src/main/res/layout/list_item_url.xml",
"chars": 1236,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "sonic-android/sample/src/main/res/values/colors.xml",
"chars": 354,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"colorPrimary\">#3F51B5</color>\n <color name=\"color"
},
{
"path": "sonic-android/sample/src/main/res/values/strings.xml",
"chars": 749,
"preview": "<resources>\n <string name=\"app_name\">sonic</string>\n <string name=\"default_no_sonic\">Load Without Sonic</string>\n "
},
{
"path": "sonic-android/sample/src/main/res/values/styles.xml",
"chars": 712,
"preview": "<resources xmlns:android=\"http://schemas.android.com/tools\">\n\n <!-- Base application theme. -->\n <style name=\"AppT"
},
{
"path": "sonic-android/sdk/.gitignore",
"chars": 544,
"preview": ".gradle\n/build\n# Ignore Gradle GUI config\ngradle-app.setting\n\n# Avoid ignoring Gradle wrapper jar file (.jar files are u"
},
{
"path": "sonic-android/sdk/build.gradle",
"chars": 3556,
"preview": "apply plugin: 'com.android.library'\napply plugin: 'com.github.dcendents.android-maven'\napply plugin: 'com.jfrog.bintray'"
},
{
"path": "sonic-android/sdk/proguard-rules.pro",
"chars": 940,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
},
{
"path": "sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/BaseSonicTest.java",
"chars": 9546,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/ExampleInstrumentedTest.java",
"chars": 1478,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/QuickSonicSessionTest.java",
"chars": 12382,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/SonicRuntimeImplTest.java",
"chars": 3817,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/SonicSessionClientImplTest.java",
"chars": 1276,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/androidTest/java/com/tencent/sonic/sdk/SonicTestData.java",
"chars": 18457,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/AndroidManifest.xml",
"chars": 268,
"preview": "<manifest\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.tencent.sonic.sdk\">\n <uses-"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/QuickSonicSession.java",
"chars": 35249,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicCacheInterceptor.java",
"chars": 5387,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicConfig.java",
"chars": 4704,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicConstants.java",
"chars": 3071,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicDBHelper.java",
"chars": 4872,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicDataHelper.java",
"chars": 13702,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicDiffDataCallback.java",
"chars": 1188,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicEngine.java",
"chars": 15171,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicFileUtils.java",
"chars": 21074,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicResourceDataHelper.java",
"chars": 9426,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicRuntime.java",
"chars": 12499,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicServer.java",
"chars": 21555,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSession.java",
"chars": 55546,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionCallback.java",
"chars": 3799,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionClient.java",
"chars": 5061,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionConfig.java",
"chars": 6791,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionConnection.java",
"chars": 21084,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionConnectionInterceptor.java",
"chars": 1655,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionStatistics.java",
"chars": 2257,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionStream.java",
"chars": 8113,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSessionThreadPool.java",
"chars": 4315,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicSniSSLSocketFactory.java",
"chars": 7302,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/SonicUtils.java",
"chars": 30780,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/StandardSonicSession.java",
"chars": 22563,
"preview": "/*\n * Tencent is pleased to support the open source community by making VasSonic available.\n *\n * Copyright (C) 2017 THL"
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadCache.java",
"chars": 5364,
"preview": "/*\n *\n * * Tencent is pleased to support the open source community by making VasSonic available.\n * *\n * * Copyright "
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadCallback.java",
"chars": 2119,
"preview": "/*\n *\n * * Tencent is pleased to support the open source community by making VasSonic available.\n * *\n * * Copyright "
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadClient.java",
"chars": 14585,
"preview": "/*\n *\n * * Tencent is pleased to support the open source community by making VasSonic available.\n * *\n * * Copyright "
},
{
"path": "sonic-android/sdk/src/main/java/com/tencent/sonic/sdk/download/SonicDownloadEngine.java",
"chars": 10572,
"preview": "/*\n *\n * * Tencent is pleased to support the open source community by making VasSonic available.\n * *\n * * Copyright "
},
{
"path": "sonic-android/sdk/src/main/res/values/strings.xml",
"chars": 66,
"preview": "<resources>\n <string name=\"app_name\">sdk</string>\n</resources>\n"
},
{
"path": "sonic-android/settings.gradle",
"chars": 26,
"preview": "include ':sample', ':sdk'\n"
},
{
"path": "sonic-iOS/.gitignore",
"chars": 1385,
"preview": "tignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## Build gener"
},
{
"path": "sonic-iOS/README.md",
"chars": 6843,
"preview": "## Getting started with iOS\n[](https://gi"
},
{
"path": "sonic-iOS/Sonic/Cache/SonicCache.h",
"chars": 5754,
"preview": "//\n// SonicCache.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic availabl"
},
{
"path": "sonic-iOS/Sonic/Cache/SonicCache.m",
"chars": 38779,
"preview": "//\n// SonicCache.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic availabl"
},
{
"path": "sonic-iOS/Sonic/Cache/SonicCacheItem.h",
"chars": 1923,
"preview": "//\n// SonicCacheItem.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic avai"
},
{
"path": "sonic-iOS/Sonic/Cache/SonicCacheItem.m",
"chars": 2398,
"preview": "//\n// SonicCacheItem.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic avai"
},
{
"path": "sonic-iOS/Sonic/Cache/SonicDatabase.h",
"chars": 1639,
"preview": "//\n// SonicDatabase.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic avail"
},
{
"path": "sonic-iOS/Sonic/Cache/SonicDatabase.m",
"chars": 8553,
"preview": "//\n// SonicDatabase.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic avail"
},
{
"path": "sonic-iOS/Sonic/Engine/SonicConfiguration.h",
"chars": 2257,
"preview": "//\n// SonicConfiguration.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic "
},
{
"path": "sonic-iOS/Sonic/Engine/SonicConfiguration.m",
"chars": 1664,
"preview": "//\n// SonicConfiguration.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic "
},
{
"path": "sonic-iOS/Sonic/Engine/SonicEngine.h",
"chars": 4517,
"preview": "//\n// SonicEngine.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic availab"
},
{
"path": "sonic-iOS/Sonic/Engine/SonicEngine.m",
"chars": 9256,
"preview": "//\n// SonicEngine.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic availab"
},
{
"path": "sonic-iOS/Sonic/Info.plist",
"chars": 753,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "sonic-iOS/Sonic/Network/SonicConnection.h",
"chars": 2074,
"preview": "//\n// SonicConnection.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic ava"
},
{
"path": "sonic-iOS/Sonic/Network/SonicConnection.m",
"chars": 5923,
"preview": "//\n// SonicConnection.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic ava"
},
{
"path": "sonic-iOS/Sonic/Network/SonicServer.h",
"chars": 3025,
"preview": "//\n// SonicServer.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic availab"
},
{
"path": "sonic-iOS/Sonic/Network/SonicServer.m",
"chars": 22570,
"preview": "//\n// SonicServer.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic availab"
},
{
"path": "sonic-iOS/Sonic/Network/SonicURLProtocol.h",
"chars": 963,
"preview": "//\n// SonicURLProtocol.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic av"
},
{
"path": "sonic-iOS/Sonic/Network/SonicURLProtocol.m",
"chars": 5092,
"preview": "//\n// SonicURLProtocol.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic av"
},
{
"path": "sonic-iOS/Sonic/ResourceLoader/SonicResourceLoadOperation.h",
"chars": 1536,
"preview": "//\n// SonicResourceLoadOperation.h\n// Sonic\n//\n// Tencent is pleased to support the open source community by making V"
},
{
"path": "sonic-iOS/Sonic/ResourceLoader/SonicResourceLoadOperation.m",
"chars": 12556,
"preview": "//\n// SonicResourceLoadOperation.m\n// Sonic\n//\n// Tencent is pleased to support the open source community by making V"
},
{
"path": "sonic-iOS/Sonic/ResourceLoader/SonicResourceLoader.h",
"chars": 1409,
"preview": "//\n// SonicResourceLoader.h\n// Sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic"
},
{
"path": "sonic-iOS/Sonic/ResourceLoader/SonicResourceLoader.m",
"chars": 3148,
"preview": "//\n// SonicResourceLoader.m\n// Sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic"
},
{
"path": "sonic-iOS/Sonic/Session/SonicSession.h",
"chars": 5023,
"preview": "//\n// SonicSession.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic availa"
},
{
"path": "sonic-iOS/Sonic/Session/SonicSession.m",
"chars": 32902,
"preview": "\n//\n// SonicSession.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic avail"
},
{
"path": "sonic-iOS/Sonic/Session/SonicSessionConfiguration.h",
"chars": 1363,
"preview": "//\n// SonicSessionConfiguration.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making Va"
},
{
"path": "sonic-iOS/Sonic/Session/SonicSessionConfiguration.m",
"chars": 1136,
"preview": "//\n// SonicSessionConfiguration.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making Va"
},
{
"path": "sonic-iOS/Sonic/Sonic.h",
"chars": 1512,
"preview": "//\n// Sonic.h\n// Sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic available.\n//"
},
{
"path": "sonic-iOS/Sonic/SonicConstants.h",
"chars": 6792,
"preview": "//\n// SonicConstants.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic avai"
},
{
"path": "sonic-iOS/Sonic/SonicProtocol.h",
"chars": 2768,
"preview": "//\n// SonicProtocol.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic avail"
},
{
"path": "sonic-iOS/Sonic/Statistics/SonicEventConstants.h",
"chars": 2534,
"preview": "//\n// SonicEventConstants.h\n// Sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic"
},
{
"path": "sonic-iOS/Sonic/Statistics/SonicEventStatistics.h",
"chars": 1613,
"preview": "//\n// SonicEventStatistics.h\n// Sonic\n//\n// Tencent is pleased to support the open source community by making VasSoni"
},
{
"path": "sonic-iOS/Sonic/Statistics/SonicEventStatistics.m",
"chars": 3119,
"preview": "//\n// SonicEventStatistics.m\n// Sonic\n//\n// Tencent is pleased to support the open source community by making VasSoni"
},
{
"path": "sonic-iOS/Sonic/Util/SonicUtil.h",
"chars": 2566,
"preview": "//\n// SonicUtil.h\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic available"
},
{
"path": "sonic-iOS/Sonic/Util/SonicUtil.m",
"chars": 8840,
"preview": "//\n// SonicUtil.m\n// sonic\n//\n// Tencent is pleased to support the open source community by making VasSonic available"
},
{
"path": "sonic-iOS/Sonic.xcodeproj/project.pbxproj",
"chars": 33848,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXAggregateTarget sec"
},
{
"path": "sonic-iOS/Sonic.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 150,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:Sonic.xcodeproj"
},
{
"path": "sonic-iOS/Sonic.xcworkspace/contents.xcworkspacedata",
"chars": 237,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"group:SonicSample/So"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/36f620dddab622727b270e6b79b20a98/main.html",
"chars": 10412,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/AppDelegate.h",
"chars": 959,
"preview": "//\n// AppDelegate.h\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making VasSonic a"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/AppDelegate.m",
"chars": 3402,
"preview": "//\n// AppDelegate.m\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making VasSonic a"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/Assets.xcassets/AppIcon.appiconset/Contents.json",
"chars": 753,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"20x20\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\""
},
{
"path": "sonic-iOS/SonicSample/SonicSample/Assets.xcassets/Contents.json",
"chars": 62,
"preview": "{\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/Info.plist",
"chars": 1182,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/LaunchScreen.storyboard",
"chars": 4415,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/RootViewController.h",
"chars": 903,
"preview": "//\n// RootViewController.h\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making Vas"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/RootViewController.m",
"chars": 8284,
"preview": "//\n// RootViewController.m\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making Vas"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicEventObserver.h",
"chars": 272,
"preview": "//\n// SonicEventObserver.h\n// SonicSample\n//\n// Created by zyvincenthu on 2018/1/15.\n// Copyright © 2018年 Tencent. A"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicEventObserver.m",
"chars": 2073,
"preview": "//\n// SonicEventObserver.m\n// SonicSample\n//\n// Created by zyvincenthu on 2018/1/15.\n// Copyright © 2018年 Tencent. A"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicJSContext.h",
"chars": 1482,
"preview": "//\n// SonicJSContext.h\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making VasSoni"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicJSContext.m",
"chars": 2209,
"preview": "//\n// SonicJSContext.m\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making VasSoni"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicOfflineCacheConnection.h",
"chars": 908,
"preview": "//\n// SonicOfflineCacheRequest.h\n// SonicSample\n//\n// Tencent is pleased to support the open source community by maki"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicOfflineCacheConnection.m",
"chars": 1707,
"preview": "//\n// SonicOfflineCacheRequest.m\n// SonicSample\n//\n// Tencent is pleased to support the open source community by maki"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicWebViewController.h",
"chars": 1295,
"preview": "//\n// SonicWebViewController.h\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/SonicWebViewController.m",
"chars": 4584,
"preview": "//\n// SonicWebViewController.m\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making"
},
{
"path": "sonic-iOS/SonicSample/SonicSample/main.m",
"chars": 1016,
"preview": "//\n// main.m\n// SonicSample\n//\n// Tencent is pleased to support the open source community by making VasSonic availabl"
},
{
"path": "sonic-iOS/SonicSample/SonicSample.xcodeproj/project.pbxproj",
"chars": 22456,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "sonic-iOS/SonicSample/SonicSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 156,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:SonicSample.xco"
},
{
"path": "sonic-iOS/SonicSample/SonicSampleUITests/Info.plist",
"chars": 680,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "sonic-iOS/SonicSample/SonicSampleUITests/SonicSampleUITests.m",
"chars": 1221,
"preview": "//\n// SonicSampleUITests.m\n// SonicSampleUITests\n//\n// Created by zyvincenthu on 2017/6/26.\n// Copyright © 2017年 Ten"
},
{
"path": "sonic-iOS/docs/iOS终端实现原理.md",
"chars": 1454,
"preview": "# sonic iOS端实现原理\n\n## Sonic主要实现思路\n 基于后端渲染直出的页面拆分成(模版)+(数据)=(网页)的模式,在不同场景下,针对(模版)和(数据)分别做更新;\n \n## 主要功能模块构成\n\n### 1."
},
{
"path": "sonic-iOS/docs/终端接入指引-iOS版本.md",
"chars": 2833,
"preview": "\n## 终端接入指引-iOS版本\n\n### 1. 引入头文件,声明协议\n\n### (1.1)编译对应平台所需的Sonic.framework ,在Build目录找到.framework文件\n\n### (1.2)将Sonic.framewor"
},
{
"path": "sonic-java/README.md",
"chars": 6493,
"preview": "## Getting started with Java\n[](https://g"
}
]
// ... and 88 more files (download for full content)
About this extraction
This page contains the full source code of the Tencent/VasSonic GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 288 files (2.1 MB), approximately 565.1k tokens, and a symbol index with 620 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.