locked
Xamarin Forms Customized Camera for iOS and Android, Custom Renderer? RRS feed

  • Question

  • User327928 posted

    I'm pretty new to Xamarin Forms and C# in general, and need som hints on the best way to create an app for iOS and Android. I want to use the Camera to take pictures / videos and later on send them through email or something, since I want customized controls on the camera, I'm guessing the stock camera won't be an option? Which gets us to Renderers, which is the best approach to this? Preferably in a MVVM way. I just want the camera and a few customized buttons on it.

    Do I make on renderer for the different buttons objects and one for the camera, the buttons I'll do as extensions of the Button class, but what about the camera?

    /Oliver

    Sunday, June 25, 2017 4:34 PM

All replies

  • User113114 posted

    Look at the Xamarin forms app called moment, a simple Google search and you should find it. There they use a custom camera controll that you can customize natively

    Monday, June 26, 2017 10:56 AM
  • User327928 posted

    Thanks for the tip @BjornB. Have looked som into moment, it's similar to Xamarin forms Custom Renderer sample Content Page.

    There's some things that I don't like with this approach though: Layout and handlers is being handled natively and not in PCL, thereby it's being done twice. would also rather have the camera as a view than a page, so that it could be put in another page using xaml or code.

    Tuesday, June 27, 2017 5:14 PM
  • User327928 posted

    And they also uses the old Hardware.Camera in the Android Renderer, which is obsolete since API 21 and replaced by Camera2 @BjornB

    Tuesday, June 27, 2017 5:19 PM
  • User300571 posted

    There is this for Camera2, but it is anything but basic:

    https://developer.xamarin.com/samples/monodroid/android5.0/Camera2Basic/

    Is this not possible to do in a simpler way for PCL?

    Friday, October 13, 2017 11:52 AM
  • User187332 posted

    @Quakeulf & @Oliv3r Take a look here for an embeddable solution using Camera2 instead of Camera for displaying a live Camera View inside your own app. The iOS version can be found here. Works well for me so hope it helps you guys as well!

    Monday, December 10, 2018 8:07 PM