0

I am currently considering if this is possible to do as a web app (not native app or phone gap app, but a javascript/HTML5 app running in the smartphone/tablet browser):

  1. User takes a picture
  2. User shares picture on a server with a comment.

As far as I know, a web app has no access to the device's camera or camera roll, so what are my options then ?

My best idea currently is to have a mail service, where the users can send the photo as a mail, so my questions are:

1) Am I right in my asumptions? 2) Any better ideas than a mail service? 3) If I decided to go the native way, will it be possible to make a phonegap app with access to the camera and photos?

ssn
  • 2,337
  • 4
  • 21
  • 27

3 Answers3

1

Yes, you can create a web application that has access to the device's camera roll. There is a catch, though. While photo uploading works with Android, it currently does not work on the stock iOS Safari browser. Users would have to download another browser to be able to upload images (I believe the iCab browser allows uploading). This could be a deal-breaker depending on who your users will be. If you're building for the public, you can't very well tell them to use a different browser. If you're building internal apps, you could probably get away with it.

Here's an example of such an app, which seems to be exactly what you're trying to accomplish: http://www.crazybikes.com/mrcjava/servlet/CBB2E.M07050s

One thing to note: That example application appears different depending on the device used to access it. In other words, if visit the app on a PC, it will look like a PC app. But, if you visit it from a smartphone, it will look like a smartphone app. To get the full experience, I'd suggest visiting it from a smartphone.

Steve
  • 156
  • 4
  • On iOS stock safari photo uploads works just fine, no need for 3rd-party browsers. The crazybikes site contains a server error, it tries to save every image to the same folder with the same name, but that file is somehow readonly? – nyuwec Feb 21 '13 at 16:55
0

If you talk about "javascript/HTML5 app running in the smartphone/tablet browser", do you mean locale deployed files or web hosted?

If you want to use web hosted files, I would give the user the posibility to upload photos. Much easier than to handle emails... In case of deployed files, I'm comming from WP7 but as I know at least android has the same and iOS should also be possible, you can use the bridge between the browser control and your native app to use the camera. But this is excatly what PhoneGap does... so I would prefer to use PhoneGap and do not have to do this for my own.

Dominik Kirschenhofer
  • 1,205
  • 1
  • 13
  • 27
  • I mean web hosted - the app is executed by the brwoeser. But how would you upload photos taken with the camera ? I don't think you can access the camera photos from the browser on an iPhone or Android. – ssn Jun 05 '12 at 10:53
  • Yes you are right... it seems "input file" is just ignored by the devices... sorry never have used this =/ – Dominik Kirschenhofer Jun 05 '12 at 12:55
0

Check out Auriga upload control (free), I've used this to take a pic on iPad and upload to my webserver. One drawback is that you cannot programmatically access the camera roll, so I can't programmatically delete the pic from the camera roll after upload.