如何用Android程序扫描破解带有红外[Infrared]传感器的BarcodeQR?

问题描述 投票:0回答:1

下面的代码可以检测手中的设备是否有红外[IR]扫描仪。如果有,则在Android应用程序打开时使红外激光闪烁。

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
            //Create an instance of ConsumerIrManager class
            android.hardware.ConsumerIrManager cIr = (ConsumerIrManager) getApplicationContext().getSystemService(Context.CONSUMER_IR_SERVICE);

            //Check whether the device has an IR hardware component or not

            boolean feature_consumer_ir = cIr.hasIrEmitter();

            if (feature_consumer_ir) {
                Log.i("IRTester",cIr.getCarrierFrequencies().toString());
                Toast.makeText(this, "Device equipped with IR Hardware component", Toast.LENGTH_SHORT).show();

            }else
            { Toast.makeText(this, "Device doesn't have any IR Hardware component", Toast.LENGTH_SHORT).show();

            }
        }

AndroidManifest.xml中必须有以下几行标签。

<uses-permission android:name="android.permission.TRANSMIT_IR" android:required="true"/>
<uses-feature android:name="android.hardware.consumerir" android:required="true"/>

谁能指导我使用红外扫描仪扫描条形码,并将扫描到的信息解读为文本输入到应用程序屏幕?任何安卓示例代码行将是巨大的帮助。

java android android-sensors
1个回答
0
投票

这些文件中包含了对应用程序进行编程所需的信息。这些信息[使用红外扫描设备扫描和破译条形码]。

Android的EMDK。

https:/techdocs.zebra.comemdk-for-android4-0tutorialtutBasicScanningAPI。

https:/techdocs.zebra.comemdk-for-android7-3tutorialtutAdvancedScanningAPI。

© www.soinside.com 2019 - 2024. All rights reserved.