获取设备 IMEI

发布于 2024-07-15 13:11:14 字数 150 浏览 5 评论 0原文

如何以适用于所有设备的通用方式获取 Java ME 设备的 IMEI

How to get the IMEI of a Java ME device in a common way that is applicable to all devices

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

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

发布评论

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

评论(4

诺曦 2024-07-22 13:11:15

通常,使用java.lang.System.getProperty()可以返回设备IMEI。

不幸的是,您需要用于获取 IMEI 的字符串参数会随着手机制造商的不同而发生变化。

要尝试的字符串:

imei
电话.imei
com.lge.imei
com.nokia.imei
com.nokia.mid.imei
com.siemens.imei
com.sonyericsson.imei
com.motorola.imei
...
你明白了。

您可能需要将字符串的最后部分大写。

结果的格式也可以改变。
它可以是一个完整的 IMEI,带有“IMEI”前缀和 17 位数字中间的 3 个“-”。
它可以是 13 或 15 位数字的标准化 IMEI...

Usually, using java.lang.System.getProperty() can return the device IMEI.

Unfortunately, the String parameter you need to use to get the IMEI will change from one handset manufacturer to the next.

Strings to try:

imei
phone.imei
com.lge.imei
com.nokia.imei
com.nokia.mid.imei
com.siemens.imei
com.sonyericsson.imei
com.motorola.imei
...
you get the idea.

you may need to uppercase the last part of the string.

the format of the result can change too.
it can be a full imei with a "IMEI" prefix and 3 "-" in the middle of 17 digits.
it can be a normalized imei of 13 or 15 digits...

雅心素梦 2024-07-22 13:11:15

没有通过 Java ME 获取 IMEI 的标准方法。 某些手机​​将 IMEI 作为系统属性公开,但其他手机则不会或要求 midlet 签署到运营商或制造商域(即不是由您签署)。

there is no standard way to get the IMEI via Java ME. some phones expose the IMEI as a system property, but others don't or require the midlet to be signed to operator or manufacturer domain (ie. not by you).

荒芜了季节 2024-07-22 13:11:15

在我正在开发的游戏中,为了为每部手机获取唯一的ID(以便它们无法复制和共享保存文件),我使用每个蓝牙设备都不同的蓝牙MAC地址和获取它的Java代码每个设备上都一样=D

In the game i'm developing, to get an unique id for every cellphone (so that they can't duplicate and share savefiles) i use the bluetooth mac address that is different for every single bluetooth device and the java code to get it is the same on every device =D

ゞ记忆︶ㄣ 2024-07-22 13:11:15

我已经尝试了 axe 和 Quickrecipeonsymbianos 所建议的方法,但是它们都以优雅的方式解决了目的。 然而,在BlackBerry中我们有getDeviceID()来获取设备的唯一id,但是Java ME缺少这个功能

I have tried what is suggested by both ax and quickrecipeonsymbianos however they both solve the purpose in an elegant way. However, in the BlackBerry we have the getDeviceID() to get the unique id of the device, but Java ME lacks this functionality

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