Workaround for file uploads on Android 4.4 using reflection

大憨熊 提交于 2019-12-03 08:31:01
Mdlc

If you're looking for a clean solution to do this this without using tricky Javascript codes and detectors. I'd recommend using a Webview alternative.

Crosswalk
I'd recommend this. It'll work similar to the official webview. It's open source and made by the same people behind ChromeView. They've got a great setup guide: https://crosswalk-project.org/documentation/embedding_crosswalk.html

Check it out: https://crosswalk-project.org/

Chromium Webview
Also inspired by ChromeView. They claim to have integrated the same API's as the official webview for easy migration. But they indicate that the Webview still might be a bit unstable.

Check it out: https://github.com/mogoweb/chromium_webview

GeckoView
Made by Mozilla. Here's a demo project that uses it. Mozilla warns: "This is not a drop webview replacement and very unstable", but it has file upload

Check it out: https://wiki.mozilla.org/Mobile/GeckoView

If you're open on using Javascript (perhaps usefull for others) try:

Kitkat Webview
It uses javascript to enable file upload in KitKat webview do this. The demo allows you to upload an image, but you should be able to edit it to fit your needs.

Check it out: https://github.com/henrychuangtw/Kitkat-WebView

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!