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...
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).
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
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
发布评论
评论(4)
通常,使用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...
没有通过 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).
在我正在开发的游戏中,为了为每部手机获取唯一的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
我已经尝试了 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