Camera Capture Works Wonders

I’m pondering whether to write a textorizer app. (I know I should stop beating that dead horse, but I still get feedback about it. It’s a good testbed, too). It would be nice to be able to have it on your mobile device, take a picture, see the results, share them, make money, etc.

However I remain more interested in the possibility of continuing to run it as an HTML5 app. But right now, the missing elements are:

  • support for the File API in some of the mobile browsers
  • offline: I need to investigate that. Saving a page “to read later” in the Android browser doesn’t save the JavaScript code, but it may be possible otherwise.
  • camera capture. This one’s no longer missing, see below.
  • make the page itself mobile-friendly (not a missing feature, just something I need to do).
  • no easy way to sell the app

Indeed, if you take your Android device, go to textorizer, and click on “select file”, it will now offer to take a picture (or select one from the device). I just tried it on my phone and it was jolly good fun. It worked with the default Android browser, Chrome and Firefox (shown below).

The only change required was to add “capture=camera” on the file upload control:

<input id="file_selector" type="file" accept="image/*;capture=camera" class="image_selector"/>

I didn’t expect it would work when you don’t actually upload a file but instead retrieve it in JavaScript, but in fact it does work, and we’re one step closer to webapps everywhere. I know it’s not yet a WHATW3CG standard, but it’s still a step forward.

This entry was posted in General. Bookmark the permalink.