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?
Related
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)
I'm working with a special image format and was creating something to dynamically generate it. I went to try it in mobile Chrome (it isn't displayable in the browser but it could be downloaded) and suddenly it opened about fifty new tabs! I fought with my browser to close them all but it just kept creating more.
http://www.sudomemo.net/images/dynamic/profile/540417_0BC7C6632064B_047.ntft
There are no redirects, no scripts. It's an image.
Any clue as to why this is happening? Have I discovered a Chrome bug?
Google Chrome 39.0.2171.93 (Official Build)
Revision bec62c44cbc7da9f6a507873382ebc111d66e9d7-refs/branch-heads/2171#{#449}
OS Android 4.4.2; XT1031 Build/KXB20.9-1.10-2.27
Steps to reproduce: Tested on Android Kit Kat, with the only installed browser being Google Chrome.
Open Chrome and go to the above link.
I figured it out a while ago.
To make it short, mobile Chrome didn't know how to handle the file, as it had a text/HTML content type but wasn't parsable as text or HTML. It got passed to the Android Content Provider, (that bit which gives you options between which apps you can use to open something), which immediately returned it to Chrome, as it's the only browser on my phone, opening it in a new tab. This looped over and over, quickly causing my phone to slow down and crash.
I found this weird behaviour in Cordova:
I have created two apps, one simple HTML 5 app and a Cordova app that runs on Samsung (S5 and Tab Pro 10.1", running KitKat), that use .
It is weird that I can see the decimal point in the keyboard when I use the WebApp (on Chrome) but it doesn't appear using the Cordova app. What's going on here and who is the causer here...
I'm using an iframe to embed a youtube video in an app for android/iOS developed using jQuery mobile and phonegap build.
Testing it on my browser works fine.
On my device (android) I see the video thumbnail, but when I click on it the screen goes black, I see the controls (play, forward and backward) and the video doesn't start.
On some other video I see the loading "circle" and after that the YT related videos.
I'm checking that the video is avaible for mobile
http://gdata.youtube.com/feeds/videos?alt=json&format=1,6&fields=entry[link/#rel='http://gdata.youtube.com/schemas/2007%23mobile']&max-result=10&category=Music&q="+mySong
Any help would be really appreciated.
This tutorial seems to work :
http://eisabainyo.net/weblog/2012/01/24/embed-a-youtube-video-iframe-in-phonegap-app/
Pay attention to this step:
Change/add the following values in PhoneGap.plist file of your app.
MediaPlaybackRequiresUserAction: NO
AllowInlineMediaPlayback: YES
OpenAllWhitelistURLsInWebView: YES
ExternalHosts
*.youtube.com
*.ytimg.com
The problem seemed to be related with the android version: on 4.0 the iframe/html5 version worked fine. The problem was on android 2.3.
I used a jqm plugin as a workaround in 2.3
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")