yale8848 / cachewebview Goto Github PK
View Code? Open in Web Editor NEWCustom implement Android WebView cache, offline website, let cahe config more simple and flexible
License: MIT License
Custom implement Android WebView cache, offline website, let cahe config more simple and flexible
License: MIT License
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
似乎是header里面没有携带cookie信息,不知道能否解决,不然感觉缓存页面的作用就比较有限了
建议增加预加载资源。
大多数情况,如游戏,网站等,都需要在APP第一次安装时,预先装载部分资源。
是否增加assets中都资源装载到缓存区
为什么找不到ren.yale.android.cachewebviewlib.CacheWebView
谢谢作者的库,对于加载是提升了不少速度,但是初始加载的时候还是有白屏时间。我搜索了相关文章,有介绍说是可以全局一个webview,首先预加载index.html,然后通过通过路由跳转具体页面,页面关闭时,webview回到index.html页面。我也做了测试,效果是会好很多,但是发现在回退,js调用出现了一些问题,内存占用也很大,作者能否写一个这方面的解决方案,谢谢。
Mobile:
All Android.
Android OS:
All OS
NetWork:
Al Network.
URL:
LIB Version:
现在的清除缓存是需要实例化,希望能够在logout的时候进行完全的缓存清除。
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
应该是手误吧?
StaticRes.java ->remove方法78行
extension = extension.replaceAll(".","");
你好,我想获取webview已经缓存好的图片,但是有时候该文件不存在,请问是什么原因呢?
CacheStatus cacheStatus = mCacheWebView.getWebViewCache().getCacheFile(url);
if (cacheStatus.isExist()) {
Intent intent = new Intent(context, ImageActivity.class);
context.startActivity(intent);
EventBus.getDefault().postSticky(new WebViewImagClickEvent(cacheStatus.getCacheFile()));
}
如题。客户端需要具体怎么做呢?能提供一个demo么?
如果是用Android Studio开发的话, 在项目目录上右键, 有一个"Reformat Code" 功能, 可以一次格式化项目的全部代码
Mobile: all
Android OS: all
NetWork: all
URL: none
LIB Version: 1.3.3
我的需求是要加载 HTML 标签而不是 URL,所以我需要使用 loadDataWithBaseURL,在原生的 WebView 是可以做到自适应屏幕,包括字体、图片等,但是 CacheWebView 使用 loadDataWithBaseURL 这个方法出来的效果就跟在电脑的浏览器模拟移动设备一样,字体、图片都非常小,既然 CacheWebView 是继承于原生的 WebView 为什么会有差别呢,是否做了其他处理?
我只是将 CacheWebView 放在 xml,然后调用 loadDataWithBaseURL,没有其他配置。
如果 这个cacheWebView能够和腾讯的tbs x5内核结合起来使用,那就无敌了。请问大牛,这样可行吗?
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
测试时发现If-Modified-Since:Last-Modified和If-None-Match:ETag同时使用去请求js、css文件时(文件未修改),会返回200,同样只添加If-None-Match:ETag也是返回200,但是只添加If-Modified-Since:Last-Modified时才会返回304。这样js、css文件一直不会被缓存。不知其中的原因。。。。
Mobile: 华为mate8、samsungS8、vivo x9 plus
Android OS: 7.0 7.1 (都是7下面的内核)
NetWork: 4G
URL: http://emobile.jiiiiiin.cn/InvestmentFinance/FinanceCalc/0
LIB Version: compile 'ren.yale.android:cachewebviewlib:1.3.9'
在使用预加载CacheWebView.cacheWebView(this).loadUrl(BaseConfig.getUrl(BaseConfig.URL_FINANCE_URL));
无论使用的是这种方式,还是在主application中使用service的方式,以上的手机都会存在加载白屏,目前前端使用的是vue构建的spa应用,但是我觉得和前端无关,只要把这行代码注释,就ok了,下面是,加载的webview相关的生命周期日志,其中onProgressChanged的newProgress只跑到10,就再也不更新了进度了。
:
但是在我的mate9/mate10上面就不会出现,麻烦老大帮忙解决一下哈。!!!
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:33.144 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:33.144 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:33.144 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ WebChromeClientImpl.onProgressChanged (WebChromeClientImpl.java:42)
03-26 18:19:33.144 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:89)
03-26 18:19:33.144 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:33.144 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ onProgressChanged 10
03-26 18:19:33.144 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ WebViewClientImpl.onPageStarted (WebViewClientImpl.java:52)
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:89)
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ 开始加载页面 onPageStarted http://emobile.jiiiiiin.cn/InvestmentFinance?l=false&BankId=9999&b=false&id=354765082709445&_locale=zh_CN&d=ANDROID&m=samsung/SM-G9500&cs=3.01&LoginType=K&sv=7.0
03-26 18:19:33.145 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:33.255 25022-25022/com.csii.mobilebank W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
03-26 18:19:33.293 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.295 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.296 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.298 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.302 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.304 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.306 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.307 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.315 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.317 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.319 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.321 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.350 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.388 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.408 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.409 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.411 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.412 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.418 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.418 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.420 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.421 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.432 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{3900c V.ED..... ......ID 0,630-1440,1232} during layout: running second layout pass
03-26 18:19:33.433 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{cb02d55 V.ED..... ......ID 0,1580-1443,2182} during layout: running second layout pass
03-26 18:19:33.456 25022-25022/com.csii.mobilebank D/baidu_location_client: baidu location connected ...
03-26 18:19:33.471 25022-25022/com.csii.mobilebank D/ViewRootImpl@eaf2231[MainActivity]: Relayout returned: oldFrame=[0,0][1440,2960] newFrame=[0,0][1440,2960] result=0x1 surface={isValid=true 547147013120} surfaceGenerationChanged=false
03-26 18:19:33.472 25022-25027/com.csii.mobilebank I/art: Compiler allocated 4MB to compile void com.alibaba.android.vlayout.layout.GridLayoutHelper.layoutViews(android.support.v7.widget.RecyclerView$Recycler, android.support.v7.widget.RecyclerView$State, com.alibaba.android.vlayout.VirtualLayoutManager$LayoutStateWrapper, com.alibaba.android.vlayout.layout.LayoutChunkResult, com.alibaba.android.vlayout.LayoutManagerHelper)
03-26 18:19:33.481 25022-25027/com.csii.mobilebank I/art: Do full code cache collection, code=101KB, data=124KB
03-26 18:19:33.481 25022-25027/com.csii.mobilebank I/art: After code cache collection, code=86KB, data=88KB
03-26 18:19:33.717 25022-25027/com.csii.mobilebank I/art: Do partial code cache collection, code=115KB, data=124KB
03-26 18:19:33.717 25022-25027/com.csii.mobilebank I/art: After code cache collection, code=115KB, data=124KB
03-26 18:19:33.717 25022-25027/com.csii.mobilebank I/art: Increasing code cache capacity to 512KB
03-26 18:19:33.731 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.732 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.736 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.737 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.739 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.740 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.741 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.741 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.742 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:33.754 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{9d272d2 V.ED..... ......ID 0,630-1440,1232} during layout: running second layout pass
03-26 18:19:33.754 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{e030fa3 V.ED..... ......ID 0,1580-1443,2182} during layout: running second layout pass
03-26 18:19:33.754 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{12382a0 V.ED..... ......ID 0,2354-1440,2628} during layout: running second layout pass
03-26 18:19:33.776 25022-25022/com.csii.mobilebank D/ViewRootImpl@eaf2231[MainActivity]: Relayout returned: oldFrame=[0,0][1440,2960] newFrame=[0,0][1440,2960] result=0x1 surface={isValid=true 547147013120} surfaceGenerationChanged=false
03-26 18:19:33.867 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{521ef6 V.ED..... ......ID 0,630-1440,1232} during layout: running second layout pass
03-26 18:19:33.867 25022-25022/com.csii.mobilebank I/ViewRootImpl@eaf2231[MainActivity]: requestLayout is already in process
03-26 18:19:33.867 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{aa52f7 V.ED..... ......ID 0,1580-1443,2182} during layout: running second layout pass
03-26 18:19:33.867 25022-25022/com.csii.mobilebank W/View: requestLayout() improperly called by com.alibaba.android.vlayout.LayoutView{fd6c564 V.ED..... ......ID 0,2354-1440,2628} during layout: running second layout pass
03-26 18:19:39.944 25022-25022/com.csii.mobilebank D/ViewRootImpl@eaf2231[MainActivity]: ViewPostImeInputStage processPointer 0
03-26 18:19:39.984 25022-25022/com.csii.mobilebank D/ViewRootImpl@eaf2231[MainActivity]: ViewPostImeInputStage processPointer 1
03-26 18:19:39.990 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:39.993 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:39.993 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:39.993 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ HomeDelegateBase.gotoH5 (HomeDelegateBase.java:225)
03-26 18:19:39.993 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:89)
03-26 18:19:39.993 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:39.993 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ xxxx 理财工具 http://emobile.jiiiiiin.cn/InvestmentFinance/FinanceCalc/0
03-26 18:19:39.993 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.018 25022-25022/com.csii.mobilebank D/TextView: setTypeface with style : 0
03-26 18:19:40.035 25022-25022/com.csii.mobilebank I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
03-26 18:19:40.064 25022-25022/com.csii.mobilebank D/InputTransport: Input channel constructed: fd=108
03-26 18:19:40.064 25022-25022/com.csii.mobilebank D/InputTransport: Input channel destroyed: fd=218
03-26 18:19:40.088 25022-25022/com.csii.mobilebank D/ViewRootImpl@eaf2231[MainActivity]: Relayout returned: oldFrame=[0,0][1440,2960] newFrame=[0,0][1440,2960] result=0x1 surface={isValid=true 547147013120} surfaceGenerationChanged=false
03-26 18:19:40.204 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.206 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:40.206 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.206 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ AbstractWebViewDelegate.initWebView (AbstractWebViewDelegate.java:99)
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:89)
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ onWebViewDelegateWebViewComponentInitialized url http://emobile.jiiiiiin.cn/InvestmentFinance/FinanceCalc/0
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ CommonSelfWebViewDelegate.onWebViewDelegateWebViewComponentInitialized (CommonSelfWebViewDelegate.java:125)
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:83)
03-26 18:19:40.207 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.208 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ onWebViewDelegateWebViewComponentInitialized
03-26 18:19:40.208 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ WebViewDelegateImpl.onBindView (WebViewDelegateImpl.java:66)
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:89)
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ onBindView loadPage http://emobile.jiiiiiin.cn/InvestmentFinance/FinanceCalc/0
03-26 18:19:40.246 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.261 25022-25143/com.csii.mobilebank D/CacheWebView: visit http://emobile.jiiiiiin.cn/InvestmentFinance/FinanceCalc/0?l=false&BankId=9999&b=false&id=354765082709445&_locale=zh_CN&d=ANDROID&m=samsung/SM-G9500&cs=3.01&LoginType=K&sv=7.0
03-26 18:19:40.298 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ WebChromeClientImpl.onProgressChanged (WebChromeClientImpl.java:42)
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:89)
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ **onProgressChanged 10**
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ Thread: main
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ WebViewClientImpl.onPageStarted (WebViewClientImpl.java:52)
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ LoggerProxy.e (LoggerProxy.java:89)
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: │ 开始加载页面 onPageStarted http://emobile.jiiiiiin.cn/InvestmentFinance/FinanceCalc/0?l=false&BankId=9999&b=false&id=354765082709445&_locale=zh_CN&d=ANDROID&m=samsung/SM-G9500&cs=3.01&LoginType=K&sv=7.0
03-26 18:19:40.299 25022-25022/com.csii.mobilebank E/PRETTY_LOGGER: └────────────────────────────────────────────────────────────────────────────────────────────────────────────────
http://www.ranwena.com/files/article/1/1268/5028890.html
这个网站的小说正文乱码,大大周末有空看看怎么回事呢?(编码问题好头疼,完全搞不懂原理……)
为什么连续打开、关闭某个网页,第三次或者往后,原始的webview加载的速度要比cacheView快,前者几乎秒开,为什么CacheWebView的速度会慢?
如题。、
实测在shouldInterceptRequest中拦截request 打开网页的速度会比正常情况慢得多。
原因是因为浏览器使用单线程调用shouldInterceptRequest,而正常情况下浏览器使用多线程加载。
crtl c+v 源码加入项目,改了initSettings()。还是无法进行缩放,不知道为什么。
发现这个框架同时开启了系统缓存和自定义缓存 ,关掉系统缓存后,部分图片无法显示 , 也没有使用异步缓存
现在资源缓存之后好像就只能按照过期时间来进行管理,如果资源加载出了问题,就没有办法强制刷新,webview设置load_no_cache也没用。感觉应该在force和normal后面再加一个模式,强制不加载本地缓存,从而更新资源
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
请教个问题,有一个20M的.MP4文件,能否使用缓存播放?
希望大哥能加以一下,同时能否可以增加动态修改缓存地址的方法
CacheWebView.cacheWebView(MyAcitivity.this).loadUrl(mPathList.get(prePage));
可不可以设置能在子线程中执行
Mobile: 国产手机~
Android OS: 6.0
NetWork: WiFI/3G/4G/5G
URL: http://shopTest.qdshsh.com/#/userId=179
LIB Version: 1.3.5
WebView 配置:
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setDomStorageEnabled(true);
settings.setDatabaseEnabled(true);
settings.setAppCacheEnabled(true);
settings.setAllowFileAccess(true);
settings.setSavePassword(true);
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
settings.setUseWideViewPort(true);
偶尔加载H5出现白屏问题 , 请教下~
i have a problem with the current method of caching.
it cause corrupted image when you close unfinished page.
because the webview still caching the image before it completed.
this problem isn't exist on default webview.
我是在安卓5.0下测试的。用CacheWebView和系统原生的WebView加载同一个页面,CacheWebView在字体和图片上的显示都比原生WebView的大,感觉像是被缩放了130%左右的样子,请问是什么原因呢?
Mobile: all
Android OS: all
NetWork: WiFI/3G/4G/5G
URL: all
LIB Version: 源码
源码里有关资源的referer的获取有些问题,如果页面不是通过 loadUrl 主动加载,比如页面内点击一个url,请求资源的referer就会丢失,有可能造成访问问题。
在shouldInterceptRequest方法里面拦截到url,给request添加了header后,调用return WebViewCacheInterceptorInst.getInstance().interceptRequest(view, request); 会报错
报错信息为:javax.net.ssl.SSLPeerUnverifiedException
请问怎么解决?
缓存失效时长如何设置
CacheWebViewClient 是 final的 想自定义都不行--
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
http://m.dmzj.com/info/zaidiyubianyuannahan.html 动漫之家的介绍页面乱码;
http://ubook.qq.com/8/index.html QQ阅读首页一些字符,比如“书架”、“登录”、“退出”之类的乱码。
麻烦作者有空看看是怎么回事呢~~
Mobile: 锤子手机-坚果Pro2
Android OS: 7.0
NetWork: 4G
LIB Version: ren.yale.android:cachewebviewlib:1.2.2
WebViewClient的两个方法不停调用,日志大量输出. 确认 link中没有 http redirect. 谢谢
7-17 17:17:31.402 7345-7345/com.example.prod D/SunSuperWebViewClient: Web View Started
07-17 17:17:31.582 7345-7345/com.example.prod D/SunSuperWebViewClient: Web View Started
07-17 17:17:31.589 7345-7345/com.example.prod D/SunSuperWebViewClient: Web View Loaded : https://secure.example.com.au/MemberOnline/MobileApp/Member/Statements?ItemsPerPage=10&Page=1&yearFilter=2016&yearFilter=2015
07-17 17:17:31.590 7345-7345/com.example.prod D/SunSuperWebViewClient: Web View Started
07-17 17:17:31.721 7345-7345/com.example.prod D/SunSuperWebViewClient: Web View Started
07-17 17:17:31.732 7345-7345/com.example.prod D/SunSuperWebViewClient: Web View Loaded : https://secure.example.com.au/MemberOnline/MobileApp/Member/Statements?ItemsPerPage=10&Page=1&yearFilter=2016&yearFilter=2015
覆盖onpagefinished事件是一个常见的需求,定义成final就没法改了。
另外有些网站的css会失效,比如手机版github……
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
好像这个库没有重写停止加载的功能?如果在加载过程中停止、后退、刷新或者点击新链接,就会出现长时间等待。
我尝试在停止加载时主动中断当前httpurlconnection,但是只能终止一个连接而已,后续的资源仍然会加载,感觉有点困惑,不知道该怎么改了(不太清楚原生内核的stoploading都干了些什么工作……)
测试页面可以用360搜索,或者手机乐园官网
我想实现WebView仅缓存图片,可用CacheWebView实现起来并不顺利。
1、不想缓存的html,无论怎么设置,还是被CacheWebView缓存了下来。
2、想缓存的webp,设置后的确缓存下来了,可出现了一个令人窒息的问题,webp的缓存有概率会不可用。
一百多张图片,有时运气好,全部从本地缓存加载了,有时运气不太好,有几十张还得从网络获取,有时运气很不好,一张也没从本地缓存加载出来,全走网络了。
折腾了CacheWebView半天,实现出来的东西并不能让人满意,稳定性非常差。在某些机型上甚至出现了首次从网络获取到图片后,再也加载不出图片的问题。
最后结合CaCheWebView图片堵塞的思路,自己开了下脑洞,在原生WebView上几行代码便实现了仅缓存图片的功能。
供参考:http://m.blog.csdn.net/qq_35813887/article/details/78966907
支持缓存https吗
这个自定义的WebView是不是在有网络的情况下就不走缓存了,直接去请求数据了?
Mobile: coolpad7230
Android OS: 4.2
NetWork: WiFI
URL: asset的html加在线图片
LIB Version: 1.3.7
我基础比较差, 你的代码看不怎么懂, 好像没看到开线程下载缓存资源啊,
还有我用你的库的时候, 我assets里面有内置的html, 里面的图片是在线的url,
我加载的时候发现内置的html也要很久才出来, 我设置了先不加载图片也是一样
而且页面变的很宽, 就好像打开了一个电脑版网页一样
我本来想自定义缓存, 看了很多资料, 但是卡在最后shouldInterceptRequest的返回里面了, 当我没有缓存的资源时, 我就去开线程下载,然后存进缓存里面, 下载完毕却不知道怎么让shouldInterceptRequest返回资源了,因为下载完毕时我在线程里面了, 请问你是怎么解决这个问题的, 谢谢!
库内部调用webview 和webclient 的地方 最好抽成一个 interface 可以自定义 实现类 用别的webview 我现在项目用的是腾讯的webview 要去你源码修改包名 这样库的耦合性太高了
Mobile:
Android OS:
NetWork:
URL:
LIB Version:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.