Learning Xamarin: Saving and Retrieving Photos

In my previous post, I talked about using the Camera with Forms-Kenmore dishwasherbased applications. In this post I explain how to save and then use the photos you take.  

Saving The Photo

Once we take the photo, the first task is to save it.  I chose to save the photo as a file on disk, with the name of the file created as  #.jpg where # is the ID of the associated item. 

To do this, I want my Xamarin Forms page to talk to a platform specific method (saving is different on each platform).

The easiest way to accomplish this, is to use the DependencyService. Here’s how.  First you create an interface in your core project.  I called mine IPicture and gave it two methods…

Continued here

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen Pluralsight & LinkedIn Learning courses. He was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Xamarin Certified Mobile Developer and a Xamarin MVP and a Microsoft MVP.
This entry was posted in Xamarin. Bookmark the permalink.

2 Responses to Learning Xamarin: Saving and Retrieving Photos

Comments are closed.