https://github.com/mathroule/test-web-view
https://github.com/mathroule/test-web-view
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathroule/test-web-view
- Owner: mathroule
- Created: 2018-11-13T17:27:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-16T00:35:01.000Z (over 7 years ago)
- Last Synced: 2025-06-18T01:42:47.140Z (12 months ago)
- Language: Java
- Size: 165 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WebView with different HTTP Clients
## Integrated HTTP clients
* Default web view without request interception
* Web view with request intercepted by [HTTP URL connection](https://developer.android.com/reference/java/net/HttpURLConnection)
* Web view with request intercepted by [Apache default HTTP client](https://developer.blackberry.com/devzone/files/blackberry-dynamics/android/classcom_1_1good_1_1gd_1_1apache_1_1http_1_1impl_1_1client_1_1_default_http_client.html)
* Web view with request intercepted by [GD HTTP client](https://developer.blackberry.com/devzone/files/blackberry-dynamics/android/classcom_1_1good_1_1gd_1_1net_1_1_g_d_http_client.html)
* Web view with request intercepted by [OK HTTP client](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)
## Setup
Setup BlackBerry Dynamics following [this setup](https://developers.blackberry.com/us/en/resources/get-started/blackberry-dynamics-getting-started.html?platform=android).
The default web view URL could be changed in [BaseWebViewActivity.java](./app/src/main/java/com/mathroule/testwebview/activity/BaseWebViewActivity.java).
## Result
Loading times in milliseconds for an URL using an HTTP client.
_Test runs on Nexus 6P emulator with Android API 26._
| URL \ HTTP client | Default web view client | HTTP URL connection | Apache default HTTP client | GD HTTP client | OK HTTP client |
|-------------------|-------------------------|---------------------|----------------------------|----------------|----------------|
| https://www.google.com | 895 ms | 942 ms | 925 ms | 1932 ms | 623 ms |
| https://github.com | 1931 ms | 2730 ms | 9787 ms | 21600 ms | 2737 ms |
| https://httpbin.org/redirect-to?url=https://www.google.com | 707 ms | 1400 ms | 1480 ms | 2560 ms | 1015 ms |