delight-im / android-advancedwebview Goto Github PK
View Code? Open in Web Editor NEWEnhanced WebView component for Android that works as intended out of the box
License: MIT License
Enhanced WebView component for Android that works as intended out of the box
License: MIT License
I'm trying to get header response on web view but in AdvancedWebVIew this feature is not included. Can you add this feature?
I have so many issues with the openFileChooser because im using a webview so. I decided to use your AdvaneWebView and im having this problem with the cast of the webview. I would apreciate if you could help me with this issue. Thanks
7954-7954/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.pinttag.pinttag, PID: 7954
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pinttag.pinttag/com.pinttag.pinttag.MainActivity}: java.lang.ClassCastException: im.delight.android.webview.AdvancedWebView cannot be cast to com.pinttag.pinttag.AdvancedWebView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2790)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855)
at android.app.ActivityThread.access$900(ActivityThread.java:181)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6117)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.ClassCastException: im.delight.android.webview.AdvancedWebView cannot be cast to com.pinttag.pinttag.AdvancedWebView
at com.pinttag.pinttag.MainActivity.onCreate(MainActivity.java:53)
at android.app.Activity.performCreate(Activity.java:6374)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2743)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855)
at android.app.ActivityThread.access$900(ActivityThread.java:181)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6117)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
public class MainActivity extends Activity implements AdvancedWebView.Listener {
private AdvancedWebView mWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mWebView = (AdvancedWebView) findViewById(R.id.webview);
mWebView.setListener(this, this);
mWebView.loadUrl("http://www.pinttag.com");
// ...
}
@SuppressLint("NewApi")
@Override
protected void onResume() {
super.onResume();
mWebView.onResume();
// ...
}
@SuppressLint("NewApi")
@Override
protected void onPause() {
mWebView.onPause();
// ...
super.onPause();
}
@Override
protected void onDestroy() {
mWebView.onDestroy();
// ...
super.onDestroy();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
mWebView.onActivityResult(requestCode, resultCode, intent);
// ...
}
@Override
public void onBackPressed() {
if (!mWebView.onBackPressed()) { return; }
// ...
super.onBackPressed();
}
@Override
public void onPageStarted(String url, Bitmap favicon) { }
@Override
public void onPageFinished(String url) { }
@Override
public void onPageError(int errorCode, String description, String failingUrl) { }
@Override
public void onDownloadRequested(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { }
@Override
public void onExternalPageRequest(String url) { }
<im.delight.android.webview.AdvancedWebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
after pressing upload i am getting the following error
01-29 04:24:11.385 32115-32115/com.example.bikesh.webviewexample I/chromium: [INFO:CONSOLE(12)] "Not allowed to load local resource: file:///android_asset/webkit/android-weberror.png", source: data:text/html,chromewebdata (12)
Hi,
Is there some plan to introduce the methods introduced on WebView (API 21) or this will be up to the user-developer?
I'm mean something like
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void acceptThirdPartyCookies(boolean enabled) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptThirdPartyCookies(this, enabled);
}
}
I can create a pull request if needed.
Great library :)
Greeting,
This AdvancedWebView seems cannot work on Android 4.4.2(ASUS ZenFone and BlueStack Simulator) with html input type=file ? I tried From 4.1(API 16) to 6.0(API 23) with Emluator or HTC devices. But Android 4.4 has no response as I press the INPUT TYPE=FILE , on function.
您好,請問一下,它是不是在Android 4.4.2 (ASUS ZenFone and BlueStack Simulator) 時,在上傳檔案這的功能,會無法正常運作?我試了4.1(Emluator,API 16) , 4.2.2(HTC one SV, API 17), 4.3(Emluator , API 18) , 5.0(Emluator,API 21) ,5.1(HTC One M7, API 22) , 6.0(HTC One M8,API 23) , 它們都可以正常回應 INPUT TYPE=FILE的openFileChooser,但是API 19的4.4沒有反應…
In README.md ur given this
Downloads are handled automatically and can be listened to
@Override
public void onDownloadRequested(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
// some file is available for download
// either handle the download yourself or use the code below
final String filename;
// ...
if (AdvancedWebView.handleDownload(this, url, filename)) {
// download successfully handled
}
else {
// download couldn't be handled because user has disabled download manager app on the device
// TODO show some notice to the user
}
}
Can you please provide how to handle download and what is final String filename.
![screenshot 3](https://cloud.githubusercontent.com/assets/12455657/7647492/9272a87e-faf7-11e4-80c9-5bf6260a36b8.png)
Hi Author,
Really it is great tool to over come all issues with default webview. i am having one problem. i have webpage which has file input. i am loading this webpage into your webview. it is working fine in other version. but in android 4.4, it is not showing filechooser. how to fix this issue please guide me.
Hello, thanks for the great job.
How can I enable multiple file select?
My HTML input element has the multiple attribute set, but it is only allowing one file to be selected!
any advice please?
Hello,
I am trying to upload images via a WebView in Android. Both your implementation as http://stackoverflow.com/questions/5907369/file-upload-in-webview are not properly working for me with Android 4.4.4. Here is an extract from the received data:
Android 4.4.4
Parameters: {"utf8"=>"✓", "authenticity_token"=>"Vximz1fjqQcRpeYvek3G3tfK2L9wiQQSm837Zj5+aBI=", "item"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007f2e49ab35f0 @tempfile=#<Tempfile:/tmp/RackMultipart20150228-10308-h8g0yc>, @original_filename="image:1641", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"item[image]\"; filename=\"image%3A1641\"\r\nContent-Type: application/octet-stream\r\n">, "description"=>"", "for_friends"=>"0", "for_family"=>"0", "for_acquaintances"=>"0"}, "commit"=>"Speichern", "user_id"=>"1"}
Android 5.0
Parameters: {"utf8"=>"✓", "authenticity_token"=>"f/5PkwJ+g/30G7oWrsUizn0Lh7jzMsGMxnz264NorzQ=", "item"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007f2e4a771710 @tempfile=#<Tempfile:/tmp/RackMultipart20150228-10308-1uacuce>, @original_filename="IMG_20150228_161113.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"item[image]\"; filename=\"IMG_20150228_161113.jpg\"\r\nContent-Type: image/jpeg\r\n">, "description"=>"", "for_friends"=>"0", "for_family"=>"0", "for_acquaintances"=>"0"}, "commit"=>"Speichern", "user_id"=>"1"}
The problem is the missing content type. Not even the filename has a content type extension. I tried things like setting the content type in the WebView manually with
setType("image/jpeg");
But that approach doesn't work. Perhaps you know a solution for this issue. Thanks!
Hi there
Thanks for the great webview. While using this webview, we are facing an issue with external link URLs inside iFrame. In our case, there are multiple iframes on a webpage www.unlockar.com/horoscope. When one clicks on the link 'Read the article on astrocenter.com' the target url opens up in the same iframe. While opening this link in chrome, it opens up the target url in another tab.
I want to sort this issue out by bringing a new webview with target url in front of user.
File picker is shown one time, but after file select no file name in Web form. Next clicks to select button have no effect
AddHttpHeader does not work when use post url in Webview
file download is not working for me when i click download button nothing happens ... file upload works great
it loads my page but after some seconds it automatically redirects to some other pages which does not belonged to my website.. plz help
This is my snippet code:
public class MainActivity extends AppCompatActivity implements AdvancedWebView.Listener {
private AdvancedWebView mWebView;
private ProgressDialog pd;
On Page Started:
public void onPageStarted(String url, Bitmap favicon) {
pd = ProgressDialog.show(this, "", "Loading...", true);
}
On Page Finished:
public void onPageFinished(String url) {
if(pd != null && pd.isShowing()) {
pd.dismiss();
}
Toast.makeText(this, "Loaded", Toast.LENGTH_SHORT).show();
}
The loading is always show, even "Loaded" message has been shown.
How to figure out this?
Did anyone implement this loading feature?
Thank You
I try using shouldInterceptRequest method by extending WebViewClient with below class:
private class MyWebViewClient extends WebViewClient{ @Override public WebResourceResponse shouldInterceptRequest(WebView view, String url) { Log.d("shouldInterceptRequest", "url: " + url); return super.shouldInterceptRequest(view, url); } }
And set it to AdvancedWebView with below code:
mWebView.setWebViewClient(new MyWebViewClient());
But when I'm start loading the webpage, nothing happens in shouldInterceptRequest.
And I found error "could not found method shouldInterceptRequest" in debug window.
But using generic WebView shouldInterceptRequest is called.
This error is thrown when pressing an upload field (input type='file'). The error is quite straight forward and is probably easily fixed. (Android 4.2 and 5.0.1 tested)
java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:815) at im.delight.android.webview.AdvancedWebView.openFileInput(AdvancedWebView.java:396) at im.delight.android.webview.AdvancedWebView$2.openFileChooser(AdvancedWebView.java:243) at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:844) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5039) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)
Receiving fatal error when accessing just the fragment that the AdvancedWebView should be on... I have AdvancedWebView.java source in it's own file. Not using the main java onCall, just another fragment to display the AdvancedWebView. Any ideas? The Line 26 it mentions is the rootView = inflater.inflate.... etc etc. line.
Here's the error:
: FATAL EXCEPTION: main
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: Process: com.test.app, PID: 27247
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: android.view.InflateException: Binary XML file line #6: Error inflating class im.delight.android.webview.AdvancedWebView
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at com.test.app.report2_Fragment.onCreateView(report2_Fragment.java:26)
Caused by: java.lang.ClassNotFoundException: Didn't find class "im.delight.android.webview.AdvancedWebView" on path: DexPathList[[zip file "/data/app/com.test.app-2/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:578)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at com.test.app.report2_Fragment.onCreateView(report2_Fragment.java:26)
10-18 16:43:36.821 27247-27247/com.test.app E/AndroidRuntime: at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
Here's the fragment:
package com.test.app;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
public class report2_Fragment extends Fragment implements AdvancedWebView.Listener {
private AdvancedWebView mWebView;
public report2_Fragment() { }
View rootView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.report2, container, false);
mWebView = (AdvancedWebView) rootView.findViewById(R.id.webview);
mWebView.setListener(getActivity(), this);
mWebView.loadUrl("http://www.example.org/");
// ...
return rootView;
}
@SuppressLint("NewApi")
@Override
public void onResume() {
super.onResume();
mWebView.onResume();
// ...
}
@SuppressLint("NewApi")
@Override
public void onPause() {
mWebView.onPause();
// ...
super.onPause();
}
@Override
public void onDestroy() {
mWebView.onDestroy();
// ...
super.onDestroy();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
mWebView.onActivityResult(requestCode, resultCode, intent);
// ...
}
@Override
public void onPageStarted(String url, Bitmap favicon) { }
@Override
public void onPageFinished(String url) { }
@Override
public void onPageError(int errorCode, String description, String failingUrl) { }
@Override
public void onDownloadRequested(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { }
@Override
public void onExternalPageRequest(String url) { }
}
Having this html:
input type="submit" value="upload file"
The button does not open the Filechooser. Is there any work around this problem?
Following the steps in the readme, Android Studio still threw warnings the Activity must be either abstract or implement AdvancedWebView's Listener methods.
It stopped complaining when I copied the methods from mWebView.setListener to the Activity class and commented out the mWebView.setListener part in onCreate altogether.
@Override
public void onPageStarted(String url, Bitmap favicon) {
// a new page started loading
}
@Override
public void onPageFinished(String url) {
// the new page finished loading
}
@Override
public void onPageError(int errorCode, String description, String failingUrl) {
// the new page failed to load
}
@Override
public void onDownloadRequested(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
// some file is available for download
}
@Override
public void onExternalPageRequest(String url) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
mWebView.getContext().startActivity(intent);
}
(I added the Intent to onExternalPageRequest to be able to have external links open in my phone's browser)
The onActivityResult
is never called in Fragments
, it's only called in a fragments parent Activity
. At the moment I have to forward the onActivityResult
to the correct Fragment
as seen below:
@Override
public void onActivityResult (int requestCode, int resultCode, Intent intent) {
if(mFragment != null)
mFragment.onActivityResult(requestCode, resultCode, intent);
}
I'm trying to implement file uploading in an app, and I'm testing on a phone with Android 5.0.1.
When I click the upload button, I can choose a file that i need, but after i select it, it doesn't appear selected in browser (this is how the looks like after i select the image:
)
Also, i have added <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
in my manifest file.
Any help is appreciated :)
Hi,
Android webView can render custom english fonts without any issue. this is not the case in custom Arabic font. here the webView looks for the default system Arabic font and renders it. it ignores any defined custom font.
Can you please bring a solution for this issue in your Android-AdvanceWebView?
Thanks
Hello, My app started crashing after adding Android-AdvancedWebView, I tried everything that I know but, still!!?
I did everything in README.md but no lock..
@Vissanu asked:
Is this libs has a CookieSync? I wanna pass a cookie to URL for auto login by token.
Something like this code :CookieSyncManager.createInstance(ActivityName.this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeSessionCookie();
String token = session.User_status;
String cookieString = "s_admin="+ token;
cookieManager.setCookie("lhttp://abc-site.com", cookieString);
CookieSyncManager.getInstance().sync();But it isn't work for me. Can you help me?
@Vissanu First, please open a separate issue for any new problem or question.
This library doesn't use CookieSyncManager
in any way because it is completely separate. You can freely use it in addition to the library without having to change the library's code.
Thus, for your specific problem, we cannot help here, unfortunately. But you may read the docs or get help on Stack Overflow where they seem to have discussed your problem already.
Hi,
Thank you for your efforts.
I'm trying to use your awesome library but I'm getting white page most of the time.
I tried it with m.facebook.com and my site doblist.com they are the same.
I'm trying the sample included with the library.
And I noticed that it's more slow than the original webView
I tried my m.facebook.com and my site on the original and they are working fine.
In the library it show a toast with "Finished loading" then a toast with the title but nothing shows in the webview.
Thank you very much
If I want upload a photo, the chooser is opened but I can't find the option 'shot a photo'. Is there? :)
Just tried your code on my LG G2 running Android 4.4.2 with an html containing input type=fileupload.
Unfortunately nothing happend, when I clicked on the "Upload" Button.
Kind regards,
Dirk
Hello, thanks for providing this framework, it works great. I was wondering if you were planning on adding the ability to display a progress bar and title bar?
It works fine for me but it alter the image name.
When I select image from browser "Attach file" , It alter the image name something like "image%xxxx"
Here xxxx are any random numbers.
Note : I'm selecting image with default name like "sample.png".
I've tried to choose different image but problem is same.
Any solution ?
See how the old Android stock browser handled downloads and check what we can re-use to improve the internal download handler.
For example, URLUtil.guessFileName could be used to determine a proper filename automatically, especially choosing the right extension.
Hi! Thanks for your work!
I would add your webview to my project (SlimSocial for Facebook).
I have added all and all works but I can only do the debug on my telephone because when I try to build an APK I have:
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Can't write [C:\Users\Leo\Source\Repos\SlimFacebook\SlimFacebook - alpha\app\build\intermediates\transforms\proguard\release\jars\3\1f\main.jar] (Can't read [C:\Users\Leo\Source\Repos\SlimFacebook\SlimFacebook - alpha\app\build\intermediates\classes\release(;;;;;;**/*.class)] (Duplicate zip entry [im/delight/android/webview/a.class == im/delight/android/webview/AdvancedWebView$1.class]))
My gradle code:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
My app gradle code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "it.rignanese.leo.slimfacebook"
minSdkVersion 15
targetSdkVersion 23
versionCode 29
versionName "2.2.4 APLPHA"
}
buildTypes {
debug {
minifyEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
zipAlignEnabled true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'MissingTranslation'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.github.delight-im:Android-AdvancedWebView:v2.1.0'
compile 'com.android.support:appcompat-v7:23.1.0'
}
On my proguard-rules.pro
-keep class * extends android.webkit.WebChromeClient { *; }
-dontwarn im.delight.android.webview.**
How can I solve this? Maybe there is incompatibility but I cannot find it :\
Thanks
When I try to load "http://convert2mp3.net" with loadurl("") method, nothing happens and logcat (in eclipse) it says "W/cr.BindingManager(31239): Cannot call determinedVisibility() - never saw a connection for the pid".
In forums, people says "set setdomstorageenabled true", but it is not working (even it is defaultly true in AdvancedWebView).
This problem only occurs Android 4.4 and above.
Please help.
Thanks
Are there any steps that need to be taken to enable file uploads?
The app is working (after a minor tweak of adding the Listener's static methods to Activity class itself instead of in mWebView.setListener and adding some code so external links would open) but clicking a file upload button triggers no action out of the box.
The page I use for testing has a regular file upload field. When I click the button in Chrome browser on my phone (or on my desktop) the file dialog box opens and I'm able to upload a file. When I click it inside the App, no luck.
The same testpage also has a fancy Bootstrap uploader (https://github.com/kartik-v/bootstrap-fileinput) - with same results.
I want to check URL param (internal URL), if contains some "string", then do not load url, and display an Alert.
And for external URL, how to implement to go to default client Browser.
Thank You
url like : custom://showImage?image=http://www.pic.com/pic1.jpeg&image=http://www.pic1.com/pic2.jpeg
i handle this in method onPageStatr()
But when i return from the GalleryActivity,the webvie show error page : can't not find custom://showImage?image=http://www.pic.com/pic1.jpeg&image=http://www.pic1.com/pic2.jpeg
how can i solve this problem ,please?
Hi,
I tried to load a URL with the help of Android-AdvancedWebView. Works fine but when I click on browse button from the HTML Page there is no option coming to capture photo from camera and upload the same to page.
Data is loaded from iFrame to android application, there is javascript dialog in iFrame for some task. all working fine in all other devices excluding Android Lollipop devices.
JavaScript Alert is not working in above api 20 in this webview.
Can you please help to show javascript dialog in Android Api >19 ?
Logcat Says "Cannot create a dialog, the WebView context is not an Activity"
Hello,
Is there a way to fix this? My backend depends on the mime-type to detect valid images and has problems to receive files from Android because of this...
Thanks.
At a small number of users I noticed that the system has to recreate the activity before delivering the result through onActivityResult(...)
. This means that also a new AdvancedWebView
will be created, which won't have the same mFileUploadCallbacks
as the original one. Is there a way to persist these, that the WebView could receive them even if it gets recreated?
How do you manipulate request URL before it is sent?
My guess is that I need to do override a method in the WebViewClient but I have no way of doing that since you do not expose the WebViewClient.
Is there a workaround?
Thanks
EDIT: Found "setWebViewClient" method.
mWebView.setListener(this, new AdvancedWebView.Listener() {
...
}
should be:
mWebView.setListener(this, new AdvancedWebView.Listener() {
...
});
Hello,
I want to use the camera as input device for images. For the HTML I tried following approaches:
<input type="file" accept="image/*">
<input type="file" accept="image/*;capture=camera">
<input type="file" accept="image/*" capture="camera">
In the Android Browser it works great with API Level 15 and 21. But in the WebView, it is not possible to use the camera directly, like you know from a native app.
API 15
https://cloud.githubusercontent.com/assets/2969758/6741622/69f1b7c2-ce89-11e4-995b-7f5af0d596a8.png
https://cloud.githubusercontent.com/assets/2969758/6741623/69f6f4f8-ce89-11e4-9668-b37db04c2c31.png
API 21
https://cloud.githubusercontent.com/assets/2969758/6741624/69f87422-ce89-11e4-9528-3d4adb67cb76.png
https://cloud.githubusercontent.com/assets/2969758/6741625/69fa6c78-ce89-11e4-8fc4-f58da3d25a6a.png
I also added the camera permission to the manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
Perhaps you know, how I have to change this in der WebView. Thanks!
Hi, I was trying to use your script to fix the problem with filechooser for example:
if I open this page in the browser http://www.francesco.iovine.name/w3c/mediacapture/ and try to upload something it's works the way it should.
But in your script it takes me to the choose a recent document instead of choose an application to complete the action. Like Camera or Audio Recorder.
I feel like I'm doing something wrong, but want to make sure, I spend so much time on this problem, all I'm trying to do is to load one page inside the app and make input field work the way it should.
I would appreciate for any help. Thank you
Is there a way to give my android app camera access permission?
Like mWebView.setGeolocationEnabled(true) for location permission, is there anything like it to allow the camera access?
Could you add some support for geolocation? Right now, trying to enable support for it via normal means (like the ones discussed here: http://stackoverflow.com/questions/5329662/android-webview-geolocation ) results in breaking file uploads.
This is probably a VERY known issue (and might even be unsolvable). But I thought I'd make an issue about it so that people know it won't work for KitKat 4.4.0->4.4.2. Also maybe update the README.md to state this?
It should work in KitKat 4.4.3+ though, but I haven't tested it myself.
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.