android-webview

Updating WebView on AOSP Android 6.0

让人想犯罪 __ 提交于 2020-01-03 17:23:48
问题 I am working on a device based on AOSP Android 6.0 (Marshmallow). I wanted to update standard Android webview to the latest version for using the latest JavaScript. For this I replaced external/chromium-webview/prebuilt/arm64/webview.apk with the latest version. Also in the frameworks/base/core/res/res/values/config.xml I changed the value of config_webViewPackageName from com.android.webview to com.google.android.webview . But when I tried to launch some application that using webview (for

Building custom WebView With Cordova 5.0 in Android

≡放荡痞女 提交于 2020-01-03 13:30:32
问题 I want to build a custom WebView with Cordova. To do this I want to override setWebChromeClient and the setWebViewClient methods. But for that I need to have a SystemWebViewClient which requires a SystemWebViewEngine, which I cant seem to get at this point. Heres my main activity public class MyActivity extends CordovaActivity implements CordovaInterface { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int threadSize = getResources().getInteger(R.integer

android webview function onPagefinished is called twice

岁酱吖の 提交于 2020-01-03 11:59:17
问题 My android webview function onPageFinished is called twice. I don't know why, but it works well on android 2.2 but when I upgrade it to 4+ it does not works. Code is attached below Code @Override public void onPageFinished(WebView view, String url) { if (url.startsWith(MobileConstants.PUSHPIN_CALLBACK_URL)) { if (url.indexOf("code=")!=-1) { String code = url.substring(url.indexOf("code=")+5); Log.i ("code", code); if (code != null && !code.equals("") ){ view.setVisibility(View.GONE); Token

android webview function onPagefinished is called twice

守給你的承諾、 提交于 2020-01-03 11:59:11
问题 My android webview function onPageFinished is called twice. I don't know why, but it works well on android 2.2 but when I upgrade it to 4+ it does not works. Code is attached below Code @Override public void onPageFinished(WebView view, String url) { if (url.startsWith(MobileConstants.PUSHPIN_CALLBACK_URL)) { if (url.indexOf("code=")!=-1) { String code = url.substring(url.indexOf("code=")+5); Log.i ("code", code); if (code != null && !code.equals("") ){ view.setVisibility(View.GONE); Token

How can I capture the whole view into a Bitmap when using crosswalk to display webpage?

天大地大妈咪最大 提交于 2020-01-03 07:14:09
问题 I use CrossWalk to display webpage, it works well. I have a feature to capture the whole content as bitmap to save into SDCard, but I cannot found a solution. Using TextureView can only capture a screen size bitmap, anyone has the same issue? BTW, I can capture the whole content using WebView.draw(). 回答1: Here's some pseudo code that may help. You can get the content height and width from the webview and then you can leverage webview.draw()...so something like the following. Bitmap bitmap =

The behavior of animated gif in WebView is very strange!!, how to fix this?

痞子三分冷 提交于 2020-01-03 05:26:08
问题 I have an application with a WebView, where there's a long list of posts that Autoloads via Ajax when the user approaches the bottom of the scrollable area, so I display the word "Loading ... " and an animated GIF beside it created via Ajax Loader site. The problem is that this Gif sometimes appear as a still image in some devices with Androind 2.3.5/2.3.6, and in other devices its animation is extremely fast, and in other devices it's extremely slow. E.g. Galaxy S Mini with OS: 2.3.6 (it

Need to show HTML page (with CSS) as a book with page flipping

ぐ巨炮叔叔 提交于 2020-01-03 03:57:28
问题 So I have a local HTML file with CSS and I need to display this file in the form of a book (scroll left/right to view previous/next content, not up and down). I've thought of a really complicated ways to achieve this: A Gallery of WebView s Disable scrolling in the WebView On swipe, scroll the WebView down the height of the WebView There's a couple of problems with this approach: I'd have to have the HTML content loaded for each WebView (extremely inefficient) There exists the possibility

How to “Monitor”the URL base in WebView

烈酒焚心 提交于 2020-01-03 03:50:05
问题 So i want to be able to monitor the URL my WebView application is loading. The main thing im trying to accomplish is to keep the WebView inside a specific Website or at least by able to detect when the user is leaving the website's URL. Example. If i have the base URL of www.google.com and when the user clicks Images, he gets "http://www.google.com/imghp" However it still has the base URL of www.google.com, so if there is a way to monitor when the base URL is no longer www.google.com, such as

Calling JavaScript function in WebView

夙愿已清 提交于 2020-01-03 03:17:11
问题 I know this question has been asked many times and I have checked all the solutions and researched everything. However, this is simply not working for me. I don't know what I am doing wrong. Can someone please help me out? I am loading a local html file in my WebView and then calling the JavaScript function: wv.loadUrl("file:///android_asset/sample.html"); wv.getSettings().setJavaScriptEnabled(true); JavascriptInterface javasriptInterface = new JavascriptInterface(MyActivity.this); wv

My WebView does not fill the tabs' screens (but fills the cellphones' screens with no pb)

与世无争的帅哥 提交于 2020-01-03 00:54:09
问题 My app needs to instantiate a WebView that displays the content of a page of a website. It works perfectly with cellphones (I've tried with various HTC's and with a recent Samsung too) but it doesn't with tablets (Galaxy Tab, or Asus Eee Pad Transformer) : instead of filling the screen the WebView appears very small. Depending of the tabs, roughly 25% to 50% of the viewport is filled, the rest is blank. It looks a bit as if I was using WRAP_CONTENT instead of FILL_PARENT . The layout I'm