Using ngf-select to try and capture from the device camera (Android) - android

I am have a cordova mobile application runnning Cordova 6.5.0 and I am trying to get the ability to capture images from the camera & upload in my mobile app using ngf-upload.
https://github.com/danialfarid/ng-file-upload
I have tried using ngf-capture="'camera'" & ngf-capture="'other'" and all this seems to do is open up the default 'Recent' files file manager application where I can select files instead of opening the camera??
Any ideas why this would be happening?
<div>
<input ngf-select="onFileSelect($files)"
ngf-fix-orientation="true"
ngf-capture="'other'"
ngf-accept="'image/*'"
ngf-validate-fn="validate($file)"
ngf-keep="true">
</input>
</div>

Related

android cordova Could not open camera with <input type="file" accept="image/*" capture="camera">

i can't use capture="camera" with cordova app in android device, although if i open the application from browser it work fine, I am sure the cordova app have all permissions to open camera
image when use cordova app:
image when use browser work fine:

html5 caputre camera on iphone not working

I'm using this html5 on the browser to open the camera only and directly without the access to the gallery to take a picture only and the user can't choose from the gallery
<input type="file" name="image" accept="image/*" capture="camera" class="form-control"/>
and this code work on all android phone but the problem is on the iPhone iOS system the gallery appear to choose image and that what i don't want i want only access to the camera to take a picture.
I try to change the browser from safari to chrome but it didn't work.
I check the version of the ios it's 9.3.5 and also don't work.
What should I to solve this problem on ios and the code work on android and ois together

file input - accept image from camera or gallery on android

I have Form in my website that accepts a file input. the code for the input is here:
<input type="file" accept="image/*" capture/>
When I run this on my note 4 with google chrome for android I get to choose only Camera apps to add the image from. I cannot choose to use image from gallery or photos.
In IPhone with Safari it works perfect. it allows me to choose from gallery or camera. what not in google chrome for android? what am i missing ?
If you are using Android 4.4 (Kit Kat) then this is a known issue:
Issue 62220
You can follow the suggested work arounds: HTML file input in android webview (android 4.4, kitkat)

Upload image on Webkit Cordova - Android 4.4

I am building a web_app using Cordova.
With the image tag :
<input type="file" accept="image/x-png, image/jpeg" value="Take a picture"/>
When I click on the input tag it let me choose images on device.
It works fine on iOS 7 , iOS 8 with Safari and Android 4.4 with Google Chrome.
My problem is, when user open my web app on device. They can do some steps on it. But suddenly the have some other task to do like "answer calls, reply text messages".
After that, they back to my web app. In Safari or Google Chrome, my app will reload. The user must start at the beginning.
I solved this problem by using Cordova. It works well.
Except on Android 4.4 the WebView component looks like doesn't support choosen file when I click on input tag.
I dont want to use Cordova Camera plugin. Because with my current implementation It's hard.
Does anyone have the same problem with me?

Can you launch the native Camera App from an Html 5 Web App?

I have a mobile website that allows users to upload photos using the file input type (Browse button). If possible, I would like to launch the Camera App of an Android device on click of the Browse button or any other HTML button. Is this possible?
I read this similar post but in their example they are asking how to register the Camera App as Intent Receiver for uploading images. Similar to that, I just want to launch the Camera App in the same way the Android browser picks up on Phone Number and Addresses.
Android 3.0 Honeycomb added Device API support.
Google I/O 2011 presentation shows an example on slide 30:
<input type="file" accept="image/*;capture=camera">
It also points to a test site that not surprisingly does not do much on my Froyo phone.
Anybody with a tablet tried it and can tell us what it does and does not do?
4.0 Icecream Sandwich was announced. Code drop may not happen for several months or longer and actual devices may show in the market around Christmas. As to Icecream on current generation of Froyo / Gingerbread phones, official ODM/carrier 4.0 releases will never happen? I'd love to be proved wrong on this. Any word from custom ROMs community?
I tried this:
<input type="file" accept="image/*" capture="camera" />
from here: https://coderwall.com/p/epwmoa
With my Galaxy S2 phone (on Chrome).
It's working and open directly the camera.
if someone need, i'm using the confirmed answer on asp.net.
i added to asp.net control the attributes accept="image/*" capture="camera"
<asp:FileUpload ID="FileUpload1" runat="server" type="file" accept="image/*" capture="camera" />
<asp:ImageButton ID="bt_AttUp" runat="server" onClick="bt_AttUp_Click" />
and on .net server side
FileUpload1.SaveAs("PathDestination")

Categories

Resources