Uwe Kreuzahler
Uwe Kreuzahler

Reputation: 71

Activate camera on android tablet through mobile website

I need to know if there is a way to activate the camera on a android tablet through a mobile website.

The goal is to have a form created on a mobile web design. Then before submitting, i need to be able to take 5 images (of a vehicle) and store those, including the form information to a database.

I know that it is possible to activate the camera through phonegap, but the client does not want to use a app. Instead he needs a mobile website.

Any helo will be appreciated.

Thanks

Upvotes: 0

Views: 875

Answers (2)

mguida
mguida

Reputation: 867

You can access the camera by using the following html5:

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

You can also use the value of "camcorder" or "microphone" for the capture field. Hope this helps!

More info: http://www.html5rocks.com/en/tutorials/getusermedia/intro/

Upvotes: 1

Simon
Simon

Reputation: 11190

You can open an Intent URL using JavaScript. So you can launch the intent to capture an image. Should will then have to ask them to select a file with a file input field.

See https://developer.chrome.com/multidevice/android/intents for more details on the URLs. And this page has the action you need to use. http://developer.android.com/training/camera/photobasics.html

I've not tried using one of these Intent URLs with AJAX but theirs a slim possibility that it might work and you'll get the resulting jpeg back.

Upvotes: 1

Related Questions