YMC
YMC

Reputation: 5452

Xamarin.Forms: Thinking about ways to store images locally on the device user takes with camera

In the proposed Xamarin app user is supposed to take multiple (5-30) images with camera and application is supposed to store them on the device to be available in the next session of user working with application. What would be the best way to do it? No needed for those images to be protected.

I think about 2 possible solutions: PCLStorage https://github.com/dsplaisted/PCLStorage, or binary data in sql-lite db https://www.nuget.org/packages/sqlite-net-pcl/.

I'm new to Xamarin, so not sure pros and cons of each approach, and maybe there is another better option. Thanks

Upvotes: 0

Views: 229

Answers (1)

lawiluk
lawiluk

Reputation: 597

From my perspective, as I don't know PCLStorage that well, I would recommend that you can do one of the following.

  1. Take photo normally with MediaPlugin. When it is stored on the device you get back path to it. You can store that path it in your database.
  2. You can store blob of an image in the database.

If I were you I would simply create PoC with the first solution. Storing blobs in Db is time-consuming. With the first approach iOS/Android is taking care of the image being stored and you only take care of the link.

Upvotes: 3

Related Questions