3

How do I get the network operator name in an app written with J2ME?

I am recently trying to develop an app on Nokia s40 which should have an exclusive access to a particular network operator. Is there any API or library of such?

gnat
  • 6,213
  • 108
  • 53
  • 73
Sunday Okpokor
  • 721
  • 6
  • 18

1 Answers1

3

There is nothing like that. But you can get the MNC and MCC Information from IMSI. With this information you can get the Operator name

Example

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

you can send the information to your database to get Country, Network Operator, Network Name and status

See http://www.numberingplans.com/?page=analysis&sub=imsinr for more information on IMSI

======= Update =====

Please note that this is dependent on phone type. Below are the different formats I know... more can still be out there.

        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");
gnat
  • 6,213
  • 108
  • 53
  • 73
Baba
  • 94,024
  • 28
  • 166
  • 217
  • Thanks but i got this error: "an internal application error occured:java.lang.NullPointerException" – Sunday Okpokor Mar 26 '12 at 09:14
  • It comes in different format in each phone .. Just updated my answer .. you also need to catch every exception ... Thanks :) – Baba Mar 26 '12 at 09:23
  • yea, that works, i used the com.nokia.mid.imei for nokia phone. Thanks :-) – Sunday Okpokor Mar 26 '12 at 09:42
  • with this now, i'm kind of confuse, i have the web app already published in ovi store and wish to update it to provide exclusivity for a particular network provider. I don't know how to combine J2ME app with the web app, should i pull down the web app which has over 8000 downloads and create a new J2ME app? – Sunday Okpokor Mar 26 '12 at 10:44
  • Create a new app and call it version 1.0.2 or .. you can also add one or two things ... to increase customer satisfaction – Baba Mar 26 '12 at 12:38