1

I am trying to do a xamarin.android application to use ML Kit, and I am folloing this steps:

1.- I create my android application in visual studio, using the template for that. 2.- In the nuget manager, I add the Xamarin.GooglePlayService.MLKit.BarcodeScanning

According with google documentation, one step it is configure the scanner, for example with this code:

val options = BarcodeScannerOptions.Builder()
        .setBarcodeFormats(
                Barcode.FORMAT_QR_CODE,
                Barcode.FORMAT_AZTEC)
        .build()

Then problem is that I can't have access to BarcodeScannerOptions.Builder.

I have tried to add the using Xamarin.GooglePlayService.MLKit.BarcodeScanning, but I don't have this namespace available.

So I wondering how I could use the bardcode sacnner of ML Kit.

Thanks.

Álvaro García
  • 18,114
  • 30
  • 102
  • 193

1 Answers1

1

I don't have any experience on xamarin.android. By google searching, looks the namespace is Xamarin.Google.MLKit.BarcodeScanning. https://www.nuget.org/packages/Xamarin.Google.MLKit.BarcodeScanning/

zhouyi
  • 226
  • 1
  • 4
  • Thanks for the suggestion, but I can using Xamarin.Google because it is not available. Also, I have download this example from their project: https://github.com/xamarin/GooglePlayServicesComponents/tree/master/samples/com.google.android.gms/play-services-vision but in a using I have the same problem, I don't have access to some namespaces so I can't compile. – Álvaro García Mar 04 '21 at 08:59
  • 1
    The sample project you linked is the deprecated Mobile Vision rather MLKit. https://developers.google.com/vision Anyway, I'd suggest you to ask this in Xamarin community and I do saw some similar requests related to this, e.g. https://github.com/xamarin/XamarinComponents/issues/932 – zhouyi Mar 06 '21 at 00:11
  • Thanks for the help. I didn't know it was a deprecated example. I have read the link that you tell me, but they closed because it library was added. But I can't find any example of how to use MLKit. – Álvaro García Mar 10 '21 at 09:20
  • Here's another related question that might be helpful. https://stackoverflow.com/questions/66613801/which-is-the-difference-between-the-two-googleplayservices-of-the-nuget-pacakges – zhouyi Mar 16 '21 at 04:21