Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Platform Agnostic Method for Automatic Image Capture (Using Camera)...

lastfreedomlastfreedom Member ✭✭
edited February 2020 in Xamarin.Forms


I'm trying to find a platform agnostic method for taking a set of still images, as fast as a device will allow (i.e. no user interaction) and store each of them in the a gallery / album. I've come across and implemented platform specific methods for doing this (Android and iOS), but want to avoid platform specific code.

Ideally, this process can be initiated via an arbitrary trigger and stopped after an arbitrary amount of time (eg. start a loop that exits when a flag is set). The process should not block pending user action (i.e. is completely automatic). User action elsewhere in the application is fine (actually essential in order to stop the automatic capture process).

Is there a platform neutral way of doing this?





  • YelinzhYelinzh Member, Xamarin Team Xamurai

    Xamarin.Forms applications typically consist of a shared .NET Standard library and individual platform projects. The platform projects contain any platform-specific logic or packages the application requires.

    Taking photos in Xamarin will call the platform api to achieve the function.

    Is there a platform neutral way of doing this?

    No. You can search for a related plugin or customize a plugin. But for the plugin, the function is still implemented for each platform.

  • lastfreedomlastfreedom Member ✭✭

    As I understand it, whilst the implementation may be platform specific, there is a layer of abstraction that one can work with that allows for platform agnostic development. If that is not the case, then what's the point of Xamarin? If I need to develop for Android and iOS independently, then I may as well use Android Studio and XCode respectively. There is already a way operate the camera in a platform agnostic manner using...

    Plugin.Media.CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions() { });

    ...however this requires user interaction to take the picture.

  • JoannaGJoannaG Member ✭✭✭


    Regarding camera invoking in android of Xamarin forms.

    I raised my query here:

    Kindly share your suggestions.

    Based on your sample i need to invoke my BLK camera(leica device) almost like another camera (Eg: YouCamPerfect or any PicEditor)

Sign In or Register to comment.