Alpha Video Training
Results 1 to 27 of 27

Thread: Image capture in list control

  1. #1
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Image capture in list control

    Have been trying to build a phonegap app that captures images on a mobile device into a list. Got it all working in live/working preview where it imports an image into the database from a computer file. Uploaded it to my phonegap project directory then the problem start. Push a capture image button and the camera fires up, take a photo and register it's okay. Save record, list shows a new dirty record no thumbnail of the photo and it will not synchronize!

    Downloaded Selwyn's sample component from the release notes (video's added 2014-18-12) set up a new database, new table with 4 fields id (int11), description (char50), location (char50), image(blob) in mySQL. tested in working preview all fine, upload to phonegap and same as my app no image gets saved.

    Anybody else having similar problems with the camera and phonegap?

    Android 5.0.1
    Phonegap 3.6.3

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,724

    Default Re: Image capture in list control

    Here are a few things to check...

    PhoneGap Build URL for all Ajax Callbacks set correctly... or set at all?
    Published your component
    Check the security for the component

  3. #3
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Thanks for looking David.

    I assume the phonegap URL is correct because it loads the records created when testing in working preview. I publish to the A5webroot directory, not a folder within it and the server is on port 80, so the url is just my ip address.
    The component is published, and is always allowed in security.

  4. #4
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Just done further testing, it is possible that the ajax callbacks that are failing!

    The only thing I can think of is my publish directory is on the I drive on my server i.e. I:\A5Webroot, how do I make sure that phonegap points to that?
    Last edited by Lance Gurd; 01-03-2015 at 04:38 AM.

  5. #5
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,724

    Default Re: Image capture in list control

    I doubt the problem is with drive I... my development server is running on E without issues. You can't assume your PGB URL is correct because when testing your component in Working / Live Preview, Alpha is not using that PGB URL. Your URL must be http://x.x.x.x

  6. #6
    Member
    Real Name
    John Haytko
    Join Date
    Dec 2007
    Posts
    106

    Default Re: Image capture in list control

    I'm having a similar problem. My app works from the working preview and from the browser. However from phonegap when you take the picture it does not display in the detail view or after saving in the list. I'm using the disconnected features. I followed the video exactly. It just plain doesn't work. Please post if you figure this out.

  7. #7
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Further testing, created a dummy button with an ajax callback, but did not create the xbasic for the callback. Published and sent to phonegap, my app then through a fatal error to do with the ajax callback and dimming variables.

    Then created the xbasic for the callback with a simple alert statement, published, tested with phonegap and the alert pops up when the button is pressed, therefore I assume my url is correct.

    There must be something else I'm missing!

  8. #8
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Made a web page out of the app and published. Accessed it via my url from a remote computer and it worked, could add a picture from that computers directory.

    Tried the same thing from my nexus phone and it also worked, took a photo with phones camera and it is saved in the database???

  9. #9
    Member
    Real Name
    John Haytko
    Join Date
    Dec 2007
    Posts
    106

    Default Re: Image capture in list control

    Lance,
    I'm experiencing the same thing. Works fine from a browser. Will not work from phonegap. I've tried the image upload settings of HTML5, Phonegap and Phonegap preferred. I can take the picture in phonegap but when I synch the data all gets inserted and the image does not. I'm using the same images and the settings are as close as I know to make them from html5 to the Phonegap options. I have the size limit set to -1. Please keep us posted if you figure this out. Very frustrating.

  10. #10
    Member
    Real Name
    John Haytko
    Join Date
    Dec 2007
    Posts
    106

    Default Re: Image capture in list control

    Lance,
    I wanted to follow up with some additional info. I noticed that when I synch from the phonegap app all the fields are getting saved to the sql database except the image. It seems to vanish. There is blob data but it's not the image. It may just be a null blob entry. I'm using mySql. I'm so sick and tired of this I'm willing to pay Alpha for tech support. Maybe someone from Alpha could help out here. Hint Hint...I think it's about $375.00 US for 5 Hrs. Maybe we could share the expense and benefit?
    John H

  11. #11
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    I have given up on the photo idea, think it must be an android thing and that's our mobile of choice. There seem to be other threads on here that report similar problems, none of which seem to have been resolved, so in my eyes a few days wasted. We can resort to using phone camera and email when this is needed, which is not very often.

    One thing I found before abandoning this idea, and this was the main cause of it, was that if I managed to save in the description/location fields photo id field( int increment) and job id (set by parent list id) both saved correctly then next time I ran the app in working preview I got the following error which prevented the main menu from showing

    Error:Script:A5W Code line:115 Error parsing data: Must be a comma or ']' after an array element.
    Delete the records from the photo table and the menu re-appeared.

    John if you need the photo side of things that badly go for the support, it is not that necessary for me.

  12. #12
    Member
    Real Name
    John Haytko
    Join Date
    Dec 2007
    Posts
    106

    Default Re: Image capture in list control

    Can't say that I blame you. If I get to the bottom of it I will still share my findings. Thanks for the dialog.

  13. #13
    Member
    Real Name
    John Haytko
    Join Date
    Dec 2007
    Posts
    106

    Default Re: Image capture in list control

    Lance,
    Not sure if you're still interested but I submitted this as a bug last night and Selwyn if putting out a patch tomorrow. Looks like it was a bug. John H.

  14. #14
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Thanks John,

    I will retry once the bug has been fixed and then see if I can incorporate in my app.

  15. #15
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Downloaded latest build and still no joy!

  16. #16
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,724

    Default Re: Image capture in list control

    I've gone through the same process you have... using the download sample. With a couple of necessary changes, it works under both Android (Kit-Kat) and iOS.

    The Action Image Capture for List-Detail view needs to be changed from HTML to PhoneGap. I haven't tried the PhoneGap Preferred option yet.

    The PhoneGap Build URL for ajax callbacks must be correct... and the component must be published.

  17. #17
    "Certified" Alphaholic
    Real Name
    Frank Bicknell
    Join Date
    Feb 2010
    Location
    39.1915° N, 84.4348° W
    Posts
    2,467

    Default Re: Image capture in list control

    Just a side note. I have been using the HTML5 image capture with android 4.3 and the built in browser and it works well. No phonegap.
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

  18. #18
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Have tried this on my nexus 7 which has Android 4.4.4 and still the same, will not save a picture. Saves the location/description fields fine.

    When I take a picture I press the tick box to accept but nothing shows in the image field and the record is not dirty until I type in either of the other 2 fields!

    Frank, as stated above if I abandon phonegap and publish this as a a web page and access through my URL it all works.

  19. #19
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,724

    Default Re: Image capture in list control

    Since your app is the one from Selwyn's video... and you use the same table... then zip and post your UX here. Also zip the PhoneGap Build Project Folder and post it here. I'll put it into my project and have a look.

  20. #20
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Hi David, Thanks for looking.

    The UX was a straight download from the release notes, but I have attached mine here just in case something has happened in the download (although I doubt this because I have created another UX with the same results).

    The phonegap url is set to 10.1.5.5 for local server testing at the moment, I have tried this with our external ip address as well which is http://164.xx.xxx.x (not sure if I should put that on here or not!)

    invent.zipPhoneGapProjects.zip

  21. #21
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,724

    Default Re: Image capture in list control

    There are 4 mistakes I usually make when working with PhoneGap.

    1. UX Security
    2. A Working AJAX Callback URL
    3. Publishing the component
    4. Ensuring I've got the Plugins I need

    I your case... assuming 1,2,and 3 are good... then I believe including the File and File Transfer Plugins will solve your issues.

    Using your UX, but plugging in my PhoneGap credentials and my URL I do not get an image showing.

    Then... checking the File and File Transfer Plugins in the Alpha/PhoneGap dialog... all is good.

    When I'm using my local server for testing, I ensure I've got the port in there as well, because my local server is running on port 81. As well, I'm publishing to a folder under A5Webroot... so my Ajax Callback URL is http://192.168.1.104:81/AlphaTest

  22. #22
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Thanks David. It was the File and File Transfer plugins that did it. I hope this helps others who have missed this.

    I now realise why I follow you on youtube, your attention to detail is brilliant!

  23. #23
    Member
    Real Name
    Simon Mayeski
    Join Date
    Jun 2010
    Location
    San Diego, CA
    Posts
    51

    Default Re: Image capture in list control

    Good news, I saw this topic before I started a new version of my app, having waited for the disconnected feature set for quite awhile. So I carefully followed these instructions and set up my PhoneGap version.
    Bad news: I STILL ran into the same problem Lance did, and my File and File Transfer plugins were correctly setup, I think. I wonder if there are other optional plugins I should be checking to add - currently I am using NONE of the "Required Third Party PhoneGap Plugins". I am selecting for Android only, the initial UX Component is the standard login component, and my URL for all Ajax Callbacks is a folder off the A5Webroot, like you guys :)
    I can take a photo any time and save it; it is when I try to synchronize with the server the photo disappears. All the other fields in the MySQL database record are saved and synced correctly,

    I see tonight there is a new update software version; don't know what it fixes or adds, though :(

    Any ideas on getting this to work would be much appreciated.

  24. #24
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Image capture in list control

    Hi Simon,

    First thing to check can you synch in working preview and save a photo from your computer to the database?

  25. #25
    Member
    Real Name
    Simon Mayeski
    Join Date
    Jun 2010
    Location
    San Diego, CA
    Posts
    51

    Default Re: Image capture in list control

    Thanks for that, Lance. I had been in Working Preview during the early development phase and had no problem doing that. Then when I moved into the PhoneGap phase I stopped and ran into the "no photo update". Now, in Working Preview I am throwing a JS error, which I don't see in the PhoneGap version. I'l check it out, maybe that is the source of my error.

  26. #26
    Member
    Real Name
    Simon Mayeski
    Join Date
    Jun 2010
    Location
    San Diego, CA
    Posts
    51

    Default Re: Image capture in list control

    Well, regardless of the JS error I'm throwing in Working Preview, it appears that my problem has been a bug that was corrected in the latest (today's) update. Wish I had known...

  27. #27
    Member
    Real Name
    Simon Mayeski
    Join Date
    Jun 2010
    Location
    San Diego, CA
    Posts
    51

    Default Re: Image capture in list control

    Well, regardless of the JS error I'm throwing in Working Preview, it appears that my problem has been a bug that was corrected in the latest (today's) update. Wish I had known...

Similar Threads

  1. Signature Capture - List Control
    By lvasic in forum Mobile & Browser Applications
    Replies: 10
    Last Post: 12-11-2014, 04:14 PM
  2. Displaying File Reference Image in List Control
    By Dfred in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 06-23-2014, 03:08 PM
  3. Replies: 3
    Last Post: 05-19-2014, 10:03 AM
  4. Capture Image file name as variable?
    By Keith Hubert in forum Alpha Five Version 10 - Desktop Applications
    Replies: 26
    Last Post: 06-27-2013, 02:17 AM
  5. Photo Image Capture
    By Tom Henkel in forum Alpha Five Version 5
    Replies: 15
    Last Post: 04-20-2004, 11:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •