I have a web page that is opening in android webview. The requirement is to launch Camera directly on tapping file chooser.
I have written following code for selecting image:
<input id="files" type="file" name="images[]" multiple accept="image/*" capture="camera"/>
This works fine in chrome browser and opens camera for capturing image. But, when same page is called inside webview, it asks for choose from Camera, Gallery and similar apps.
Take a look at this repo on Github which is an example of how to to upload and process images/videos in a Webview-based app.
Don't forget to add this in your AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
If you have any more question just ask. I hope it solves your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With