Android File Upload with WebView 

I was working on a project called Neighbors Social Network, where the project called for for a progressive web app (PWA) to be integrated into an existing native iOS and Android app. Integration was as expected on both platforms:

  1. Create native web view for each platform.
  2. Direct the web views to the PWA’s url.

An additional requirement was to have the ability to upload images saved on the device. The iOS web view just worked and did not need any addition coding. Android on the other hand was not so cooperative.

After a few days of duckduckgo’ng I came across a Stack Overflow question that described a straightforward implementation that didn’t have any “hidden” api’s.

https://stackoverflow.com/questions/36410012/android-cant-upload-images-using-webview

From this discussion I distilled a minimum coding example that worked in my project and will hopefully help someone else.