I am using the following code on a Samsung device. It has been working but recently we started getting an error. I am getting the alert box with a error code of 20 in it. Is there a way I can get the description for error 20?
pui.capturePhoto({
dir: get("ImagePath"),
fileName: "image.jpg",
overwrite: true,
handler: function(response) {
if (response.success) {
pui.click(ImageEITaken);
}
else {
alert(response.error);
}
}
});
Picture Capture on Samsung
-
- Profound User
- Posts: 80
- Joined: Mon Apr 20, 2009 11:26 am
- First Name: Devin
- Last Name: St. Germain
- Company Name: Dupre Logistics, LLC
- Phone: 337.314.2259
- Address 1: 201 Energy Pkwy. Ste. 500
- City: Lafayette
- State / Province: Louisiana
- Zip / Postal Code: 70508
- Country: United States
- Contact:
-
- 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: Picture Capture on Samsung
Its not clear what error you're receiving. You just say "20"? the "response.error" that you are using should contain a message.
Can you post a screenshot?
Can you post a screenshot?
-
- Profound User
- Posts: 80
- Joined: Mon Apr 20, 2009 11:26 am
- First Name: Devin
- Last Name: St. Germain
- Company Name: Dupre Logistics, LLC
- Phone: 337.314.2259
- Address 1: 201 Energy Pkwy. Ste. 500
- City: Lafayette
- State / Province: Louisiana
- Zip / Postal Code: 70508
- Country: United States
- Contact:
Re: Picture Capture on Samsung
Is this what you need Scott?
- Attachments
-
- AlertBox.jpg (19.74 KiB) Viewed 1750 times
-
- 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: Picture Capture on Samsung
I've never seen a response like that before. Profound UI does not send any messages that just contain the number "20" like that.
Looking at the code for the pui.capturePhoto() API, there are two places where the handler might get an error code that doesn't originate with Profound UI. They are:
1) When accessing the camera itself, we use the Cordova camera.getPicture() function, and it can return the device's native response code. The documentation for that can be found here: https://cordova.apache.org/docs/en/late ... ra.onError -- however, that doc isn't very helpful, it doesn't list the possible values. I suspect they are different for each mobile device.
2) When uploading the picture to the IBM i, we call Cordova's FileTransfer.upload function. It can return an error code, too, as documented here: https://cordova.apache.org/docs/en/6.x/ ... index.html -- however, I don't think this is what you're seeing, because if that were the case it would say "An error has occurred: Code = 20" instead of just "20". Also, this only documents errors from 1-5, so I don't think 20 is possible.
So I think it's probably #1, above... this is simply the code that the device's camera is returning, and every device returns different values. I don't know what 20 means, sorry.
Looking at the code for the pui.capturePhoto() API, there are two places where the handler might get an error code that doesn't originate with Profound UI. They are:
1) When accessing the camera itself, we use the Cordova camera.getPicture() function, and it can return the device's native response code. The documentation for that can be found here: https://cordova.apache.org/docs/en/late ... ra.onError -- however, that doc isn't very helpful, it doesn't list the possible values. I suspect they are different for each mobile device.
2) When uploading the picture to the IBM i, we call Cordova's FileTransfer.upload function. It can return an error code, too, as documented here: https://cordova.apache.org/docs/en/6.x/ ... index.html -- however, I don't think this is what you're seeing, because if that were the case it would say "An error has occurred: Code = 20" instead of just "20". Also, this only documents errors from 1-5, so I don't think 20 is possible.
So I think it's probably #1, above... this is simply the code that the device's camera is returning, and every device returns different values. I don't know what 20 means, sorry.
-
- 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: Picture Capture on Samsung
I did some Googling, and it appears that the "20" code is returned by some Android devices to indicate a permission error.
This is the closest thread I can find (and its referring to ionic, which isn't quite the same as what we use) https://forum.ionicframework.com/t/came ... -20/109710
Not sure that I understand 100%, but it sounds like the app doesn't have permission to read from the Camera or its stored pictures. You could try looking for a setting in your phone that allows the app access to the camera?
If that doesn't help, you should file a support ticket so that we can have our developers look into the error further.
This is the closest thread I can find (and its referring to ionic, which isn't quite the same as what we use) https://forum.ionicframework.com/t/came ... -20/109710
Not sure that I understand 100%, but it sounds like the app doesn't have permission to read from the Camera or its stored pictures. You could try looking for a setting in your phone that allows the app access to the camera?
If that doesn't help, you should file a support ticket so that we can have our developers look into the error further.
-
- Profound User
- Posts: 80
- Joined: Mon Apr 20, 2009 11:26 am
- First Name: Devin
- Last Name: St. Germain
- Company Name: Dupre Logistics, LLC
- Phone: 337.314.2259
- Address 1: 201 Energy Pkwy. Ste. 500
- City: Lafayette
- State / Province: Louisiana
- Zip / Postal Code: 70508
- Country: United States
- Contact:
Re: Picture Capture on Samsung
I would have to agree that it would not be during the upload because the camera never does open so no picture is taken to upload. I will review the link you sent for number 1 and see if I can find any reference on the net about this. I thought it may be a permissions issue but those have been setup as needed. Thanks!!
-
- Profound User
- Posts: 80
- Joined: Mon Apr 20, 2009 11:26 am
- First Name: Devin
- Last Name: St. Germain
- Company Name: Dupre Logistics, LLC
- Phone: 337.314.2259
- Address 1: 201 Energy Pkwy. Ste. 500
- City: Lafayette
- State / Province: Louisiana
- Zip / Postal Code: 70508
- Country: United States
- Contact:
Re: Picture Capture on Samsung
Just saw your latest post Scott. Thanks for the additional info. Looks like the permissions may have been the correct path. I will post back here anything I find for future reference. Thanks Again!!
Who is online
Users browsing this forum: No registered users and 1 guest