gpt4 book ai didi

java-me - 知道 J2ME 中的网络运营商名称

转载 作者:行者123 更新时间:2023-12-02 00:23:38 26 4
gpt4 key购买 nike

如何在使用 J2ME 编写的应用程序中获取网络运营商名称?

我最近正在尝试在 Nokia s40 上开发一个应用程序,它应该具有对特定网络运营商的独占访问权限。有没有这样的API或库?

最佳答案

没有那样的东西。但是您可以从 IMSI 获取 MNC 和 MCC 信息。通过这些信息,您可以获得运营商名称

例子

String imsi = System.getProperty("IMSI"); // Example 234103530089555
String mcc = imsi.substring(0,3); // 234 (UK)
String mnc = imsi.substring(3,5); // 10 (O2)

您可以将信息发送到您的数据库以获取国家、网络运营商、网络名称和状态

参见 http://www.numberingplans.com/?page=analysis&sub=imsinr有关 IMSI 的更多信息

=======更新=====

请注意,这取决于手机类型。以下是我所知道的不同格式……还有更多格式。

        System.getProperty("phone.imei");
System.getProperty("com.nokia.IMEI");
System.getProperty("com.nokia.mid.imei");
System.getProperty("com.sonyericsson.imei");
System.getProperty("IMEI");
System.getProperty("com.motorola.IMEI");
System.getProperty("com.samsung.imei");
System.getProperty("com.siemens.imei");
System.getProperty("imei");

关于java-me - 知道 J2ME 中的网络运营商名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9861368/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com