Search code examples
androidwebviewandroid-4.4-kitkat

Determine which Android Kitkat devices suffer from Webview fileupload dialog bug


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.


Solution

  • 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.