Learn how to allow users to upload images from their device’s camera or gallery in Mendix Native apps. This guide covers adding the image widget, configuring it to access the camera and gallery, handling permissions, and saving the captured or selected images to your app’s database.
Go to MX Studio Pro Create a new module Pictures.
Go to the domain model, add a new entity named Picture, and generalize it with Image.

Right Click on Pictures module -> Add page -> Native mobile & give the name Picture -> Inside navigation layout select NativePhone_Default(Atlas_Core).

Go to the Picture page & take a dataview -> double click on dataview select nanoflow as DataSource & create a new nanoflow(DS_Picture).

Open DS_Picture nanoflow -> take a create object activity & create Picture object & return the object.


Image Upload From Gallery :-
Go to the Picture page & take a button inside dataview named Upload Image.

Double click on Upload Image button -> In onClick events select call a nanoflow & create a new nanoflow(ACT_UploadImage).

Open ACT_UploadImage nanoflow & take a TakePicture activity.

Open TakePicture activity & set all the values. Make sure to select imageLibrary as picture source.

Go to Navigation -> Native mobile & add a new item(Picture) and select Picture page.


Now run the application & test it.
When you click the Upload Image button, your device’s image library will open.


Conclusion:
I hope this article has helped you understand How To Take Pictures from Gallery In Mendix Native App.
Thanks for reading this! See you in the next blog post.
