Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 带有摩托罗拉XT907设备的Scandit-相机未对焦_C#_Android_Camera_Barcode_Barcode Scanner - Fatal编程技术网

C# 带有摩托罗拉XT907设备的Scandit-相机未对焦

C# 带有摩托罗拉XT907设备的Scandit-相机未对焦,c#,android,camera,barcode,barcode-scanner,C#,Android,Camera,Barcode,Barcode Scanner,我正在测试一个我正在制作的可以扫描条形码的应用程序。这个应用程序将是跨平台的,所以我正在使用VisualStudio与Xamarin一起开发。我决定使用Scandit,因为它似乎是Xamarin最好的条形码扫描库 我遇到的问题是在这个特定的设备上,相机非常模糊,似乎无法自动对焦。正因为如此,我很难让任何东西正确扫描 手机内置的摄像头应用程序工作出色,对焦效果良好。其他条形码应用程序似乎也能很好地聚焦。我在另一台Android设备上试用了我的应用程序,效果很好。它似乎是这个特定设备和Scandit

我正在测试一个我正在制作的可以扫描条形码的应用程序。这个应用程序将是跨平台的,所以我正在使用VisualStudio与Xamarin一起开发。我决定使用Scandit,因为它似乎是Xamarin最好的条形码扫描库

我遇到的问题是在这个特定的设备上,相机非常模糊,似乎无法自动对焦。正因为如此,我很难让任何东西正确扫描

手机内置的摄像头应用程序工作出色,对焦效果良好。其他条形码应用程序似乎也能很好地聚焦。我在另一台Android设备上试用了我的应用程序,效果很好。它似乎是这个特定设备和Scandit的组合

正在扫描的条形码类型将全部为代码128。我禁用了所有其他类型,这似乎有很大帮助,但扫描仍然非常困难

这是我的密码:

public class MainActivity : Activity, Scandit.Interfaces.IScanditSDKListener
{
    private ScanditSDKBarcodePicker picker;
    const string APP_KEY = "it's a secret.";

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        SetContentView(Resource.Layout.Main);            

        Button button = FindViewById<Button>(Resource.Id.MyButton);

        button.Click += delegate
        {
            picker = new ScanditSDKBarcodePicker(this, APP_KEY);
            picker.OverlayView.AddListener(this);

            picker.SetCode39Enabled(false);
            picker.SetCode93Enabled(false);
            picker.SetEan13AndUpc12Enabled(false);
            picker.SetEan8Enabled(false);
            picker.SetUpceEnabled(false);
            picker.SetItfEnabled(false);
            picker.SetMsiPlesseyEnabled(false);
            picker.SetGS1DataBarEnabled(false);
            picker.SetGS1DataBarExpandedEnabled(false);
            picker.SetQrEnabled(false);
            picker.SetDataMatrixEnabled(false);
            picker.SetPdf417Enabled(false);
            picker.SetCodabarEnabled(false);

            picker.StartScanning();

            SetContentView(picker);
        };
    }

    public void DidScanBarcode(string barcode, string symbology)
    {
        Toast.MakeText(this, string.Format("barcode scanned: {0}, '{1}'", symbology, barcode), ToastLength.Long).Show();
    }

    public void DidCancel()
    {
        Toast.MakeText(this, "Cancel was pressed.", ToastLength.Long).Show();
    }

    public void DidManualSearch(string text)
    {
        Toast.MakeText(this, "Search was used. " + text, ToastLength.Long).Show();
    }
} 
public类MainActivity:Activity,Scandit.Interfaces.IScanditSDKListener
{
私人条码选择器;
const string APP_KEY=“这是一个秘密。”;
创建时受保护的覆盖无效(捆绑包)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Button Button=FindViewById(Resource.Id.MyButton);
按钮。单击+=委派
{
picker=新的ScanditSDKBarcodePicker(此,应用程序键);
picker.OverlayView.AddListener(this);
选择器。SETCODE39已启用(false);
选择器。SetCode93Enabled(假);
picker.setean13和upc12已启用(false);
选择器。SETEAN8已启用(false);
picker.SetUpceEnabled(false);
picker.SetItfEnabled(false);
picker.SetMsiPlesseyEnabled(假);
picker.SetGS1DataBarEnabled(false);
选择器。SetGS1DataBarExpandedEnabled(false);
picker.SetQrEnabled(假);
picker.SetDataMatrixeEnabled(false);
选择器。SETPDF417已启用(错误);
picker.SetCodabarEnabled(false);
picker.StartScanning();
SetContentView(选择器);
};
}
公共条形码(字符串条形码、字符串符号)
{
MakeText(this,string.Format(“条形码扫描:{0},{1}',符号学,条形码”),ToastLength.Long.Show();
}
公共取消
{
Toast.MakeText(这是“已按取消”。,ToastLength.Long.Show();
}
公共搜索(字符串文本)
{
Toast.MakeText(这是“使用了搜索”。+text,ToastLength.Long.Show();
}
} 

原来这是Xamarin的Scandit库的一个bug。我给开发者发了电子邮件,他们告诉我应该在下一个版本中修复,他们说下一个版本将在11月中旬发布。我下载了他们最新的Scandit演示应用程序,该程序刚刚更新,现在运行良好

因此,当Scandit4.3公开时,这一问题应该得到解决