1

In my J2ME application i want to detect network type whether it is 2G or 3G. According to network type, i need to take some different actions. How can it be done by code?

dhrut
  • 147
  • 1
  • 9

1 Answers1

0

For Network type following syntax is used

String value = System.getProperty("com.nokia.network.access");

You can check this artical.

The return values can be as follows,

  • pd - Packet data in GSM network

  • pd.EDGE - Packet data in EDGE network

  • pd.3G - Packet data in 3G network

  • pd.HSDPA - High speed downlink packet access for 3G networks

  • csd - Circuit switched data, for example GSM CSD/HSCSD data call

  • bt_pan - Bluetooth PAN network

  • wlan - Wireless network, for example 802.11b, 802.11G or WiMaX

  • na - Not applicable, the implementation can’t determine the type

So based on return value, you can get the Network Type.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
  • hey i have tried in my LG phone like System.getProperty("com.lge.imei") .but its giving me null.why its like this? – dhrut Mar 20 '12 at 08:23
  • so can you give me correct syntax? beacuse i have taken this syntax from internet only. see i m giving you link also [link](http://ashnatechnologies.blogspot.in/2010/01/how-to-get-device-imei-number-using.html) – dhrut Mar 20 '12 at 08:29
  • Actually, isn't com.nokia.network.access Nokia specific? I think for other manufacturers you have to consult their SDK documentation / developer page, that should be your starting point. Simply substituting com.nokia with other name is most likely wrong. – Code Painters Mar 26 '12 at 22:45