通过 Android 诊断损坏的外设(例如...检测损坏的蓝牙)

发布于 2024-12-28 08:53:22 字数 90 浏览 3 评论 0原文

如果手机组件正常工作或损坏,我正在寻找获得反馈的机会。有什么特别之处吗?

示例:我想通过java代码启用蓝牙传感器,但蓝牙传感器已损坏。有什么异常吗?

Im searching for a opportunity to get feedback, if a mobile phone component is working or damaged. Is there any special feature?

Example: I want to enable Bluetooth sensor via java code, but the Bluetoothsensor is damaged. Any Exception or so?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

从﹋此江山别 2025-01-04 08:53:22

设备可能不会通知您已损坏。

如果您尝试访问蓝牙并且蓝牙已损坏,您将无法获得它的任何功能,并且您会收到错误,但不是类似“蓝牙损坏”之类的错误。检查蓝牙文档以了解各种错误。

probably, the device, not informs you, that is damaged.

If you try to access to the bluetooth and the bluetooth is damaged, you cannot get any features of it, and you get an error but not an error something like "Bluetooth damaged". Check the bluetooth documentation for the kinds of errors.

海拔太高太耀眼 2025-01-04 08:53:22

如果您希望能够查看高级硬件统计信息(例如 RAM 时钟和电压)并执行运行状况测试(例如低级 SD 读写测试) - 最可靠的方法是使用本机代码来系统调用。但许多调用都需要设备 root

一般而言,Android API 只会为您提供硬件的可用性,如下所示(采取 此处):

// Check for available NFC Adapter
mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (mNfcAdapter == null) {
    Toast.makeText(this, "NFC is not available", Toast.LENGTH_LONG).show();
}

但是你不能将其解释为故障或任何其他情况。我不知道 Android Java API 的任何部分是正式用于诊断硬件故障的。

您可以获取 Android 源代码 并查看 NfcAdapter.getDefaultAdapter() 为您提供的功能关于如何使用 Java API 获取硬件的想法。

If you want to be able to see advanced hardware stats (like RAM clock and voltage) and perform health tests (like low-level SD read-write tests) - the most sure-fire way to do that is to use native code to make system calls. But many calls will require the device to be rooted

Generally, Android API will just give you availability of hardware, like so (taken here):

// Check for available NFC Adapter
mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (mNfcAdapter == null) {
    Toast.makeText(this, "NFC is not available", Toast.LENGTH_LONG).show();
}

But you can't interpret this as malfunction or anything. I don't know of any part of Android Java API that's officially meant to diagnose hardware malfunctions.

You can get Android source code and see what NfcAdapter.getDefaultAdapter() does to give you an idea on how hardware you can get with Java API.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文