In input type file is does not shows the option of camera in android platform

Hello,

 <input type="file" accept="image/*;capture=camera">

is does not showing the options of camera in android platform, it is working in ios platform. please help me to solve this issue .

i am using ionic version 4.1.2,

Thanks

Depending on he version of Android you are testing on, this might not be supported. What is the android OS version you are deploying to?

https://caniuse.com/#feat=input-file-accept

thanks for reply,
i am deploying my app to android version 7.0.0

Hello! I am also facing this issue using the latest Ionic 5.0.7 and Capacitor 2.0.0.
It works fine using Chrome on Android to visit the webapp version of my Ionic project, but not when using the native app compiled with Capacitor. I can select previously taken pictures, but no option to use the Camera.

Anybody? I tried multiple values for the accept prop, still not showing up the camera on Android…

      <input
        type="file"
        id="file-upload"
        accept="image/*"
        capture
        @change="setImage"
      />

This works for me…

You mean it shows the Camera in the native app compiled for Android? I have the same exact code and it doesn’t on my side

Ionic V4:
Does this even work? I have no access to trigger event from HTML input type. The scenario is I have an angular web application as micro front end which is imported as web component in my ionic app. So all i have access is to change HTML of micro app:
i tried:
<input type="file" accept="image/*;capture=camera"> which is not working…

Can we trigger camera via input type file. by default it lunches the file browser of the whatever browsers it is clicked and in android as well it launches documents directory. However it doesn’t ask for an option to choose camera or gallery. is there a way to handle this type of scenario in android and ios platforms?

Yes it works, it just Javascript

For android its not working… it directly launches mobile documents

1 Like

Are you using the EXACT same code as I posted? Your code looks different?