Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

building a barcode scanning feature with Xamarin (we are encountering specific problem)

$
0
0

Background: We are trying to incorporate a barcode scanning feature into our mobile app. Specifically, this is a VIN scanner to make it more efficient for auto mechanics to do vehicle inspections. Here is a problem we are encountering.

Details: I wanted to integrate one third-part library for VIN scanning (it works very good on old Android devices, which is important). But unfortunately, it doesn't build for Xamarin.

I've taken Java example and rewrote it in C#, but that doesn't work, and I don't know why. I am hoping the Xamarin team or community can help.

This is Java code from example:

public class B4HScanner
{
     public float acuracy;

      // load native library when initializing
      static
      {
            System.loadLibrary("b4hvinscanner");
      };

      // constructor
      public B4HScanner()
      {
            super();
            acuracy = 1.0f;
      }

      // parse VIN code from "data" or NULL if VIN code not found
      public native String parse( byte []data, int size, int width, int height, int q, Context context);

      // check status of Bees4Honey scanner license
      public native int status(Context context);
}

I need to use "parse" method from this class, so I rewritten this class to C#:

public class B4HScanner
{
      public const float Acuracy = 0.1f;

      static B4HScanner()
      {
            //JavaSystem.LoadLibrary("b4hvinscanner");
      }

      [DllImport("libb4hvinscanner.so")]
      public extern static string parse(byte[] data, int size, int width, int height, int q, Context context);
}

But every time I'm calling B4HScanner.parce method, I'm getting "System.EntryPointNotFoundException: parse"

Not sure what I am doing wrong. Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>