webview

MathJAX in Android

◇◆丶佛笑我妖孽 提交于 2020-01-13 12:11:24
问题 I am trying to display math formulae in Android's webview. I ve written the code in a separate html file and using the following code to display the formulae: String data =inputStreamToString1(); myWebView.loadData(data, "text/html", "utf-8"); I've placed the following lines in the html file to load mathJAX dynamically: <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> The problem is when I run the app in emulator

android WebView Note

拟墨画扇 提交于 2020-01-13 12:10:26
在Android手机中内置了一款高性能webkit内核浏览器,在SDK中封装为一个叫做WebView组件。 什么是webkit WebKit是Mac OS X v10.3及以上版本所包含的软件框架(对v10.2.7及以上版本也可通过软件更新获取)。 同时,WebKit也是Mac OS X的Safari网页浏览器的基础。WebKit是一个开源项目,主要由KDE的KHTML修改而来并且包含了一些来自苹果公司的一些组件。 传统上,WebKit包含一个网页引擎WebCore和一个脚本引擎JavaScriptCore,它们分别对应的是KDE的KHTML和KJS。不过, 随着JavaScript引擎的独立性越来越强,现在WebKit和WebCore已经基本上混用不分(例如Google Chrome和Maxthon 3采用V8引擎,却仍然宣称自己是WebKit内核)。 这里我们初步体验一下在android是使用webview浏览网页,在SDK的Dev Guide中有一个WebView的简单例子 。 在开发过程中应该注意几点: 1.AndroidManifest.xml中必须使用许可"android.permission.INTERNET",否则会出Web page not available错误。 2.如果访问的页面中有Javascript,则webview必须设置支持Javascript。

Find out if Android WebView is showing cached page

最后都变了- 提交于 2020-01-13 09:02:50
问题 I'm making an Android application that, among other things, shows websites in a webview. As far as I understand, the webview automatically shows a cached version of the page if a connection can't be established. Is there any way to find out if the page shown has been fetched from the server or cache? Maybe even how old the cached page is. This is to be able to notify the user if he/she is viewing old information. 回答1: You could try a hack - at first set WebView's cache mode to WebSettings.NO

Find out if Android WebView is showing cached page

被刻印的时光 ゝ 提交于 2020-01-13 09:02:13
问题 I'm making an Android application that, among other things, shows websites in a webview. As far as I understand, the webview automatically shows a cached version of the page if a connection can't be established. Is there any way to find out if the page shown has been fetched from the server or cache? Maybe even how old the cached page is. This is to be able to notify the user if he/she is viewing old information. 回答1: You could try a hack - at first set WebView's cache mode to WebSettings.NO

Xcode Wkwebview not Loading

橙三吉。 提交于 2020-01-13 07:35:06
问题 I have a Xcode Project with a Webview and a TabBar and with the TabBar I can switch between WebViews. My Problem is that when I put something in my ShoppingCard under lieferworld.de and switch with the TabBar to my Shopping Card url the Items in there are not Visible. How can I solve this? the ShoppingCard URL ends with .php. Below is the code which is implemented Here is also a Video were you can see the error: https://youtu.be/qU3Mu1G7MY0 Viewhome: import UIKit import WebKit class viewHome:

android webview 简单浏览器实现

喜你入骨 提交于 2020-01-13 07:17:19
文件main.java package com.HHBrowser.android; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Button; import android.widget.EditText; public class main extends Activity { /** Called when the activity is first created. */ WebView wv; Handler handler; Button btnButton; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); wv = (WebView)findViewById(R.id

UIWebView和WKWebView的对比

自古美人都是妖i 提交于 2020-01-13 03:04:56
1.UIWebView和WKWebView UIWebView 1)UIWebView是iOS2就有了的,占用内存也比较多,内存峰值也挺夸张的 2)UIWebView继承自UIView 是用来加载网页的类,可以简单理解成就是一个view WKWebView 1)相比UIWebView的话,支持更多的HTML5的特性 2)滚动刷新率在60fps以及内置手势 3)添加了加载进度属性:estimatedProgress 4)和Safari想听的JavaScript引擎 WKWebView的流程 在发送请求之前决定是否跳转 --> 第一次进入页面 --> 页面开始加载时调用 --> 收到服务器跳转请求之后执行 --> 收到服务器跳转请求之后再执行 --> 收到响应后决定是否跳转 --> 内容开始返回时调用 --> 页面加载完成之后调用 之后进入页面 --> 在发送请求之前决定是否跳转 --> 收到服务器跳转请求之后执行 --> 收到服务器跳转请求之后再执行 --> 收到响应后决定是否跳转 --> 内容开始返回时调用 --> 页面加载完成之后调用 在开发过程中会经常遇到网页加载慢的现象,原因有:网速过慢,大图渲染,图片异步下载等,只要与线程异步处理有关都是,设备系统只是影响用户体验度。 OC和JS的交互方式 WKWebViewConfiguration *config = [

What is the difference between Android webview's loadData and loadDataWithBaseURL

China☆狼群 提交于 2020-01-12 23:17:40
问题 The Android webview has 2 methods to load data public void loadData (String data, String mimeType, String encoding) Note that JavaScript's same origin policy means that script running in a page loaded using this method will be unable to access content loaded using any scheme other than 'data', including 'http(s)'. To avoid this restriction, use loadDataWithBaseURL() with an appropriate base URL. and public void loadDataWithBaseURL (String baseUrl, String data, String mimeType, String encoding

What is the difference between Android webview's loadData and loadDataWithBaseURL

↘锁芯ラ 提交于 2020-01-12 23:17:10
问题 The Android webview has 2 methods to load data public void loadData (String data, String mimeType, String encoding) Note that JavaScript's same origin policy means that script running in a page loaded using this method will be unable to access content loaded using any scheme other than 'data', including 'http(s)'. To avoid this restriction, use loadDataWithBaseURL() with an appropriate base URL. and public void loadDataWithBaseURL (String baseUrl, String data, String mimeType, String encoding

android与H5交互 的问题

a 夏天 提交于 2020-01-12 15:19:05
遇到的问题 通过WebView .loadUrl ()加载 空白的问题 ssl认证失败 重写 webView.setWebViewClient(new WebViewClient() { @Override public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { sslErrorHandler.proceed();//继续 // sslErrorHandler.cancel();//取消 注意的是 把super 的方法去掉 } }); Android 与前端 交互 传值 传值 调用 //jsFunction 前端方法名 //param 传的内容 注意格式 是String 还是 jsonObject 等 JSONObject jsonObject = new JSONObject(); try { jsonObject.put("assid", ""); jsonObject.put("sssid", ""); } catch (JSONException e) { e.printStackTrace(); } webView.loadUrl(("javascript:" + jsFunction + "(" + param + ")")