2

Since there is a known bug in Android Kitkat versions (most commonly 4.4.2) that disallows users to open file upload dialog after tapping any HTML file element within WebView, can Android itself determine if current device suffers from this bug?

Determining only by Android version is not a good solution since not all devices running 4.4.2 suffer from this bug.

2 Answers 2

0

I had to deal with this problem too. Eventually I decided it's not worth it because not that many device modifies the stock webkit, so I applied the workaround based on version number alone (SDK_INT == 19)

However if webkit is really the culprit (and not some other system class), you may want to detect the webkit version: https://stackoverflow.com/a/29218966/828752

From https://developer.chrome.com/multidevice/webview/overview#what_version_of_chrome_is_it_based_on_:

The WebView shipped with Android 4.4 (KitKat) is based on the same code as Chrome for Android version 30. This WebView does not have full feature parity with Chrome for Android and is given the version number 30.0.0.0. The updated WebView shipped with Android 4.4.3 has the version number 33.0.0.0.

2
  • Is the webkit version which suffers from this bug known? I was unable to find any solid solutions on this bug so far.
    – John Doe
    Jan 14, 2016 at 10:46
  • I am trying to avoid this solution since it generalizes detection to all 4.4.2 and lower Androids. This would include many currently working devices.
    – John Doe
    Jan 14, 2016 at 22:27
0

This detection method isnt very elegant however as there is no precise way to detect occurrence of this bug on a device best way is to count via javascript how many times a user has clicked the HTML FILE element.

If the counter of clicks exceeds some value (because the user is trying to get it work over and over) you know its not working. At this point by far most common version with this bug is 4.4.2 so you can activate this counter only when this Android version is detected for extra layer of precision.

Like I said, this detection method is quite messy however if Android has a bug this is as good as it gets. Users who dont experience this bug are unlikely to click more than once the HTML FILE element.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.