Access camera

  
Hi , everybody!!

I'm searching from sample/example on how to integrate the phonegap code to accessing the iPhone camera and upload it with some other data in the same form like an upload widget. I'm lost in this integration...
Pedro Cardoso wrote:
Hi!
Have you seen Ruben's post about PhoneGap?

http://www.outsystems.com/forums/discussion/9911/how-to-build-a-hybrid-app-using-phonegap-builder/
 Yes, Pedro. But the post is superficial. I created a Xcode project and my webapp is loagind perfectly but seems like none of my plugins are enabled. Do I have to create resources for any .js inside plugins directory to load them?
 
Hi GT1,

If you want to get a picture of the user phone (or want him to take one immediatly), you no longer need to go hybrid.... You can use HTML5 like
<input type="file" accept="image/*;capture=camera">
Check this post to know more.

Cheers,

RG
Hi Ruben,
How do you do that practically on service studio?
Hello again, I don't have much knowledge about html so i would like a more detailed explanation if possible

I inserted the above mentionned HTML code in an xy expression on my webscreen like explained here: http://www.outsystems.com/forums/discussion/6656/how-to-include-custom-html-in-your-application/
when i navigate to the page from my phone i get a button saying "Choose file" and by clicking it i get access to the camera where i can take a snapshot, great !!
now how can i get catch that picture file to process it in some action
can that be done automaticaly after the picture is taken? and how
A detailed for dummies answer would be of great help for novice/wanabe developpers like myself, and highly appeciated :)


Hi Ayoub,

Instead of the previous technic have you tried to use the upload widget of the platform?



If I'm not mistaken, this actually enables you to do exactly the same, and will make it easier for you to get the file then.

Let me know if it works,

Cheers,

RG
Hi Ayoub,

As Ruben mentioned you can just use the file upload widget but you still have to put there the accept attribute and to do that you must use the Extended Properties of the file upload widget. You'll find them on the properties pan (lower right corner of Service Studio) when you select the widget on the screen.

This component in the forge as this implemented you can go and check it out on the mobile eSpace module of it.

Cheers
Hello Ruben, Andre,
Thank you for the prompt reply !
That's exacly what I've been doing, but after taking the picture the user has to push another button in order to get to the action that processes the file
It would be much neat if right after taking the picture i can capture the file and process it directly
Also, from an end user perspective, is it possible to click on a button or link and get directly taken to the camera instead of having to click on the browse/choose file button?

also if i would like to access other functionalities like geolocation through html5, I would need to know -also- how to capture the feedback data from the phone and process it within the agile platform
 
Thank you in advance !


Hi Ayoub,

You can actually implement an onchange event on the file input. I tested it on the component I mentioned, here's a screen shot.



Cheers

André Vieira wrote:

Hi Ayoub,

As Ruben mentioned you can just use the file upload widget but you still have to put there the accept attribute and to do that you must use the Extended Properties of the file upload widget. You'll find them on the properties pan (lower right corner of Service Studio) when you select the widget on the screen.

This component in the forge as this implemented you can go and check it out on the mobile eSpace module of it.

Cheers

Is there a way to activate the webcam if we are running from a Desktop browser? I do see the option to open the camera on my phone, but do not see that functionality on my desktop.


Thanks!