无法正常调用Scan Kit的startScanFromFragment方法

The startScanFromFragment method of Scan Kit cannot be called as expected

我开发了一款物流APP,需要经常扫描包裹上的条码。我试过集成ZXing实现条码扫描功能,但在强光、弯曲、变形等场景下,无法准确识别条码...现在集成了HUAWEI Scan Kit,但是 startScanFromFragment(Fragment f, int code, HmsSanAnalyzerOptions o) 方法不起作用。因为我正在使用的 fragment 继承自 androidx.fragment.app. 我该怎么办?请给我一些分数。

我不知道将片段与扫描套件一起使用。最好能有一些上下文,因为我找不到任何关于它的文档。

但是,Scan Kit should be exactly what you are looking for your use case. To my knowledge there are three different ways on how to implement it. The Default View Mode is the easiest implementation, with the Customized View Mode you are able to change the UI of the scanning process and the Bitmap Mode 允许您完全自定义扫描过程。

我的假设是默认或自定义视图模式足以满足您的物流应用。

What should I do? Plz give me some points.

上面我为您链接了扫描套件的所有可用代码实验室,因为它们为您提供了有关如何集成其不同模式的分步指南。如果您需要 Kotlin 版本的指南,可以在 Java 版本旁边的 this 页面上找到它们。

startScanFromFragment中的fragment参数为android.native.fragment。但是,android.native.fragment API 即将被弃用,不会包含在扫描工具包 API 参考中。建议使用startScan(Activity a, int code, HmsSanAnalyzerOptions o)方式扫描条码

另外,Scan Kit 提供四种集成模式:默认视图、自定义视图、位图和多处理器。 Scan Kit 能够在远距离、具有挑战性的场景中以及无论条码的朝向如何,都能够准确快速地扫描条码。 要了解更多信息,请访问 HUAWEI Scan Kit