webchromeclient

Android WebView WebChromeClient : inaccurate progress value in onProgressChanged()

自古美人都是妖i 提交于 2019-12-04 08:34:51
I need to access the progress value in WebView -> WebChromeClient -> onProgressChanged(). The progress integer value doesn't increment from 0 to 100 but rather jumps around. Here is a sample log-output from loading one page and the associated progress numbers: DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress :

WYSIWYG in Android webview

浪尽此生 提交于 2019-12-03 20:27:40
问题 I've been trying to offer a WYSIWYG HTML editor to my users, from inside my app. It doesn't have to be a fancy WYSIWYG. I just need basic functionality like Bold, Italic, Underline, images, link and some basic formatting (font size, colour, alignment). That should be enough. The perfect solution would be an open source library, but I haven't been able to find one. So I googled around for a web-based editor that works on Android. I found Sceditor. This editor works great when I fire up my

Workaround for file uploads on Android 4.4 using reflection

大憨熊 提交于 2019-12-03 08:31:01
From Android 4.1 to Android 4.3, you could subclass WebChromeClient on Android and implement the following (hidden, thus no @Override ) method: public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) { ... } You would open a file picker in that method, and when your Activity receives the result in onActivityResult(...) , just call the single method that is available on the ValueCallback<Uri> instance with the file URI. That's it. Unfortunately, this method was removed from the API in Android 4.4 and is not being called anymore. Is there any way you can work

Android Ask for permission to use location within webview

怎甘沉沦 提交于 2019-12-02 22:02:00
问题 I have an application that uses a webview and inside the webview is a map, I have got it working to the user automatically find the users location with the following code: Manifest file Permissions: <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_GPS" /> <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" /> <uses-permission android:name="android.permission.ACCESS_LOCATION" /> <uses-permission android

can't open file chooser in WebView Android 4.4.2 using WebChromeClient

£可爱£侵袭症+ 提交于 2019-12-01 07:16:31
In my webview by clicking "Choose File" button In samsung 7 inch tablet I want to open a File Browser, but I can't open this in Android Version 4.4.2 . So can u plz help me for this? Here is my Code. WebViewDemo.java package com.example.webviewdemo; import java.io.File; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Configuration; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.Parcelable; import android.provider.MediaStore; import

can't open file chooser in WebView Android 4.4.2 using WebChromeClient

冷暖自知 提交于 2019-11-30 17:59:31
问题 In my webview by clicking "Choose File" button In samsung 7 inch tablet I want to open a File Browser, but I can't open this in Android Version 4.4.2 . So can u plz help me for this? Here is my Code. WebViewDemo.java package com.example.webviewdemo; import java.io.File; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Configuration; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import

WYSIWYG in Android webview

自古美人都是妖i 提交于 2019-11-30 15:54:35
I've been trying to offer a WYSIWYG HTML editor to my users, from inside my app. It doesn't have to be a fancy WYSIWYG. I just need basic functionality like Bold, Italic, Underline, images, link and some basic formatting (font size, colour, alignment). That should be enough. The perfect solution would be an open source library, but I haven't been able to find one. So I googled around for a web-based editor that works on Android. I found Sceditor . This editor works great when I fire up my Android browser (Chrome beta). It SEEMS to work from my webview (see screenshot) as well, but it doesn't.

webChromeClient opens link in browser

霸气de小男生 提交于 2019-11-30 06:48:30
问题 I have searched and read a lot of posts but can not figure out how to do it in my code. I want to use geolocation in my app and need to view in webChromeClient in stead of webViewClient wich I use for the html files now and the links does stay in the same view. When I change this to webChromeClient, the html links, like <a href="http://url/file.php?q=123" , are suddenly opening in the browser! How can I prevent this? myWebView = new WebView(this); myWebView.getSettings().setJavaScriptEnabled

Android WebView Playing HTML5/h.264/mp4 Video, How to get at the MediaPlayer

眉间皱痕 提交于 2019-11-29 05:34:05
I have an Activity which is a WebView . I have a WebChromeClient inside it. Inside that, there are several callbacks which are meant to return the MediaPlayer handling the video bits. For example: @Override public void onPrepared(MediaPlayer mp) { Log.i(TAG, " -------------> onPrepared"); } These fail to fire when I load an MP4 stream into the WebView using HTML <video> tags (via injection). When I finish() the activity, the logcat reports this: 09-13 23:55:24.590: E/MediaPlayer(7949): mOnBufferingUpdateListener is null. Failed to send MEDIA_BUFFERING_UPDATE message. 09-13 23:55:24.680: E

webChromeClient opens link in browser

冷暖自知 提交于 2019-11-28 21:21:07
I have searched and read a lot of posts but can not figure out how to do it in my code. I want to use geolocation in my app and need to view in webChromeClient in stead of webViewClient wich I use for the html files now and the links does stay in the same view. When I change this to webChromeClient, the html links, like <a href="http://url/file.php?q=123" , are suddenly opening in the browser! How can I prevent this? myWebView = new WebView(this); myWebView.getSettings().setJavaScriptEnabled(true); myWebView.getSettings().setLoadWithOverviewMode(true); myWebView.getSettings()