41
Views
16
Comments
Solved
Camera Plugin
Question
Application Type
Mobile

Hello!

I tried to use the camera plugin from this documentation:

https://success.outsystems.com/documentation/11/extensibility_and_integration/mobile_plugins/camera_plugin/

But when I test it on my smartphone, both "take a picture" and "record a video", seems to be having some sort of problem. Every time I try to take a picture, it does indeed take de picture, but then it doesn't "save" it on my variable. It asks for a second picture and only then, does that second picture get saved on my app. (Same for recording a video).

I tried to study and find the problem, but I can't.

 Did someone ever dealt with this? Or someone that could help me?
Thank you very much in advance!

UserImage.jpg
Puja Rani
Solution

That's fine :) .  I have attached the OML here for reference. 

Camera_forum.oml
UserImage.jpg
Puja Rani

Hi,

Can you share the logic what you have while uploading an image or if u can upload the oml to see the implementation. That would help to suggest better.

UserImage.jpg
Frederico Mateus

Hello!

Thank you for reaching out. I'm not sure if this is what you requested, but I hope it helps!

Capture.PNG
Capture2.PNG
Capture3.PNG
UserImage.jpg
Puja Rani

hmm this is bit weird, as checked your screenshots, there is no such code that would trigger this kind of issue. Even I tried the same but this behavior was not reproducible. Hope your mobile app build is updated?

UserImage.jpg
Frederico Mateus

Yes! I updated it several times and tried on them all on two different devices, but it always behaves the same way... I also don't see any error on my code. But it's strange that you didn't get the same problem as me... I don't know how to fix this hahaha
Thank you very much for helping!

UserImage.jpg
Frederico Mateus

Btw, this is what happens to me:
1- I take photo. I don't edit it (rotation etc). I click Ok. It opens the camera again to take photo. I don't take the second photo and I click on the "X" button. It goes back to the screen with the error "the app could not take a picture" (the second error on the logic).
2- I take a photo. Don't edit. Click Ok. It opens the camera again. I take second photo. Don't edit. Click Ok. Second photo appears saved on my screen.
Basically it has that first step with the first photo that's bugging somehow

UserImage.jpg
Puja Rani


I did the similar steps but one thing here, after taking picture if I click "X" , for me it didn't go back to the app screen, my camera is still open. It shows the error only if I press back button from my mobile.

UserImage.jpg
Frederico Mateus

I don't understand then.... Is it common to share apps here on the Outsystems community? Or is it better not to?


UserImage.jpg
Puja Rani

If it is your personal environment and does not have any sensitive data then it is fine to share, but in case your app contains organization sensitive data then don't share.

UserImage.jpg
Frederico Mateus

It is from my personal environment and there's no sensitive data. But then maybe it's better not to put it here just in case XD I'm new to all of this haha
Well... Then I guess it'll remain a mystery ahhahah Thank you so much for trying to help any way!
(If your app works at the first photo taken, is there any way you can send me your module so I can see your coding and try to compare to mine?)

UserImage.jpg
Frederico Mateus

Through the OutSystems IPP portal? https://www.outsystems.com/homeIpp/IPP_Page.aspx

UserImage.jpg
Puja Rani
Solution

That's fine :) .  I have attached the OML here for reference. 

Camera_forum.oml
UserImage.jpg
Frederico Mateus

So... You have the exact same thing as I have, but I just tried your screen on my app, and your logic works fine, but mine still continues with the error... I don't understand ahah But I guess I'll just create a new screen with the one you created ahahah 
Thank you so much!!!!!!!!!!

UserImage.jpg
Frederico Mateus

Ok, I guess I found the difference. You created a button from scratch and I used the source block "CameraPlugin\TakePicture". Maybe the error comes from that ahahaha 
Thank you so much again!

UserImage.jpg
Puja Rani

Oh, you were using the block "CameraPlugin\TakePicture ", in that case I get your issue. You don't have to write the logic on Take Picture action again(which is why that issue is occurring), that logic is already handled from the block. You just need to create a handler and get the binary data and display. Attaching the updated OML, please check.

Camera_forum_updated.oml
UserImage.jpg
Frederico Mateus

Oh!!!! I see!!!!!
Thank you so much!!! You're a life saver!!!
I get it now! Thank you! :D

UserImage.jpg
Puja Rani
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.