Possible to capture image like an upload file and save in database

Possible to capture image like an upload file and save in database

  

Mobile app to capture an image from the mobile phone's camera and save it like an upload file in a database.


Thank you.

Hi Edwin,

Yes, this is possible. 

Use the Camera plugin and store the binary in the local storage.

Then use the sync functionality to store the binary in the centralized database.

Kind regards,

Remco Dekkinga

Actually no need for Camera plugin.

Just create an entity (can be database or local), that contain an attribute with Binary data type.

In mobile screen, just drag a Form, then drag that attribute to the Form.

Outsystems will scaffolding an upload widget for you.

When running that application, you can click Upload, then phone will ask if you want to upload from Phone Gallery or from Camera.

To save the image binary, in the save button, before calling CreateOrUpdateEntity, assign UploadWidget.binary to your list.current.binaryattribute record variable.

Harlin Setiadarma wrote:

Actually no need for Camera plugin.

Just create an entity (can be database or local), that contain an attribute with Binary data type.

In mobile screen, just drag a Form, then drag that attribute to the Form.

Outsystems will scaffolding an upload widget for you.

When running that application, you can click Upload, then phone will ask if you want to upload from Phone Gallery or from Camera.

To save the image binary, in the save button, before calling CreateOrUpdateEntity, assign UploadWidget.binary to your list.current.binaryattribute record variable.

Mobile Upload does NOT have a "binary" attribute. It binds to the list automatically and updates the binary data there.

J.Ja

Justin James wrote:

Harlin Setiadarma wrote:

Actually no need for Camera plugin.

Just create an entity (can be database or local), that contain an attribute with Binary data type.

In mobile screen, just drag a Form, then drag that attribute to the Form.

Outsystems will scaffolding an upload widget for you.

When running that application, you can click Upload, then phone will ask if you want to upload from Phone Gallery or from Camera.

To save the image binary, in the save button, before calling CreateOrUpdateEntity, assign UploadWidget.binary to your list.current.binaryattribute record variable.

Mobile Upload does NOT have a "binary" attribute. It binds to the list automatically and updates the binary data there.

J.Ja

Thanks for correcting.

I want to add some notes here:

1. Camera plugin will resize image to small resolution which often produces jagged lines because of simple resize algorithm used.

2. Image upload widget will return original resolution of your phone camera which can be as high as 16 megapixels (or more) which is common nowadays... That will give you time out when sending record to server for database saving.

That's why I developed Image Utils Mobile (can be found in Forge) which can resize on client-side those 16 megapixels image to smaller resolution without sacrificing image quality. It will also correct image orientation which will be useful for some phone like Samsung which does not trully rotate image, but instead put orientation hint on EXIF data.