Page 1 of 3
Program example
Posted: Tue Oct 09, 2012 12:28 pm
by jac53
Where can I find the source code like the example presented by Scott in the Webinar?
Re: Program example
Posted: Tue Oct 09, 2012 12:41 pm
by Scott Klement
It's not currently available. However, we are considering making it available in the future. (We have been discussing it internally.)
Having said that, for the most part, it's just an ordinary ProfoundUI application. It has a subfile on the left, and input/output fields on the right.
Is there a particular technique that I used in that application that you'd like to learn? These forums would be a great place to discuss it!
Re: Program example
Posted: Tue Oct 09, 2012 2:03 pm
by jac53
The photo capture/attachment Technique . Is it a specific Genie API?
Re: Program example
Posted: Tue Oct 09, 2012 2:28 pm
by Alex
The Photo Capture API will not work with Genie. It will only work with a Profound UI Rich Display File program packaged as a PhoneGap Mobile Application.
Re: Program example
Posted: Tue Oct 09, 2012 3:06 pm
by jac53
I know it does not work with Genie. I was planning to create a new application using Profound Ui.
Re: Program example
Posted: Tue Oct 09, 2012 3:11 pm
by Alex
The API you will need is pui.capturePhoto(). It is documented here:
http://www.profoundlogic.com/docs/displ ... config+%29.
The following link describes how to create a Photo Capturing application similar to the one presented in the Webinar:
http://www.profoundlogic.com/docs/displ ... ile+Device.
Re: Program example
Posted: Tue Oct 09, 2012 3:37 pm
by jac53
Thanks a million!
Re: Program example
Posted: Tue Oct 09, 2012 3:45 pm
by Scott Klement
A few things are worth explaining, I think:
- The picture you saw in that app was just a regular image widget, pointed to a file in the IFS.
- The button below it (that takes the picture) is just a regular button widget, but it is not bound to a DDS field. Instead, it's "onclick" property is set to takePicture()
- The takePicture() javascript function that it calls is coded in the PhoneGap app.js file. There's an example in the link that Alex provided.
- The takePicture() routine replaces the IFS object that the image widget shows, so when the screen is refreshed, you see the newly taken picture in the image widget.
- the URL on the image widget has a random number appended to prevent caching (also explained in the link Alex provided.)
It's a little weird the first time you code it, but after you've done it once, it's really simple.
Re: Program example
Posted: Thu Oct 11, 2012 3:40 pm
by jac53
I created the application described in the links. I am getting this error and I cannot find what the problem is.
See attached file.
Re: Program example
Posted: Thu Oct 11, 2012 4:13 pm
by Scott Klement
Did you compile your project into an app? Or are you just running it from a browser?
Unfortunately, the camera doesn't work from a browser, you need to create an app.