Program example

Use this board to ask questions or have discussions with other Rich Displays users.
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Program example

Post by jac53 »

Where can I find the source code like the example presented by Scott in the Webinar?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Program example

Post 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!
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Re: Program example

Post by jac53 »

The photo capture/attachment Technique . Is it a specific Genie API?
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Program example

Post 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.
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Re: Program example

Post by jac53 »

I know it does not work with Genie. I was planning to create a new application using Profound Ui.
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Program example

Post 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.
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Re: Program example

Post by jac53 »

Thanks a million!
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Program example

Post 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.
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Re: Program example

Post 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.
Attachments
photo.JPG
photo.JPG (32.51 KiB) Viewed 4467 times
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Program example

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest