Hi All,
I want to get the following parameters in Nokia E72 [series 60 FP2]mobile set:-
1. CelliD 2. LAC 3. MCC 4.MNC
I tried the following code on E72 device but not able to get LAC.
package cms.gps;
public class NetworkCredentials {
public String cellID = "";
public String lac = "";
public String mcc = "";
public String mnc = "";
public String imsi = "";
public NetworkCredentials()
{
updateCredentials();
}
private void updateCredentials()
{
updateForDefault();
UpdateNokiaCredentials();
}
private void updateForDefault()
{
//cell id
cellID = System.getProperty("Cell-ID");
if( cellID == null || cellID.equals("null") || cellID.equals("")){
cellID = System.getProperty("CellID");
}
if( cellID == null || cellID.equals("null") || cellID.equals("")){
cellID = System.getProperty("phone.cid");
}
//lac
lac = System.getProperty("phone.lac");
//imsi
imsi = System.getProperty("IMSI");
if( imsi == null || imsi.equals("null") || imsi.equals("")){
imsi = System.getProperty("phone.imsi") ;
}
//mcc
mcc = System.getProperty("phone.mcc") ;
//mnc
mnc = System.getProperty("phone.mnc") ;
}
private void UpdateNokiaCredentials()
{
//cellid
if( cellID == null || cellID.equals("null") || cellID.equals("")){
cellID = System.getProperty("com.nokia.mid.cellid");
}
//lac
if( lac == null || lac.equals("null") || lac.equals("")){
lac = System.getProperty("com.nokia.mid.lac");
}
//imsi
//imsi = System.getProperty("IMSI");
if( imsi == null || imsi.equals("null") || imsi.equals("")){
imsi = System.getProperty("com.nokia.mid.mobinfo.IMSI");
}
if( imsi == null || imsi.equals("null") || imsi.equals("")){
imsi = System.getProperty("com.nokia.mid.imsi");
}
//mcc
if( mcc == null || mcc.equals("null") || mcc.equals("")){
mcc = System.getProperty("com.nokia.mid.countrycode");
}
//mnc
if( mnc == null || mnc.equals("null") || mnc.equals("")){
if(imsi!= null && !imsi.equals("")){
mnc = imsi.substring(3,5);
}
}
if( mnc == null || mnc.equals("null") || mnc.equals("")){
mnc = System.getProperty("com.nokia.mid.mnc");
}
if( mnc == null || mnc.equals("null") || mnc.equals("")){
mnc = System.getProperty("com.nokia.mid.networkID");
}
if( mnc == null || mnc.equals("null") || mnc.equals("")){
mnc = System.getProperty("com.nokia.mid.networkid");
}
}
}
I tried code for Samsung JET device and got the value of LAC properly
The code I tried on Samsung is :-
package cms.gps;
public class NetworkCredentials {
public String cellID = "";
public String lac = "";
public String mcc = "";
public String mnc = "";
public String imsi = "";
public NetworkCredentials()
{
updateCredentials();
}
private void updateCredentials()
{
updateForDefault();
updateSamsungsCredentials();
}
private void updateForDefault()
{
//cell id
cellID = System.getProperty("Cell-ID");
if( cellID == null || cellID.equals("null") || cellID.equals("")){
cellID = System.getProperty("CellID");
}
if( cellID == null || cellID.equals("null") || cellID.equals("")){
cellID = System.getProperty("phone.cid");
}
//lac
lac = System.getProperty("phone.lac");
//imsi
imsi = System.getProperty("IMSI");
if( imsi == null || imsi.equals("null") || imsi.equals("")){
imsi = System.getProperty("phone.imsi") ;
}
//mcc
mcc = System.getProperty("phone.mcc") ;
//mnc
mnc = System.getProperty("phone.mnc") ;
}
private void updateSamsungsCredentials()
{
//cellid
if( cellID == null || cellID.equals("null") || cellID.equals("")){
cellID = System.getProperty("com.samsung.cellid");
}
if( cellID == null || cellID.equals("null") || cellID.equals("")){
cellID = System.getProperty("CELLID");
}
//lac
if( lac == null || lac.equals("null") || lac.equals("")){
lac = System.getProperty("com.samsung.cellid");
}
if( lac == null || lac.equals("null") || lac.equals("")){
lac = System.getProperty("LAC");
}
//imsi
//no special code for it
//mcc
//no special code for it @vishal
if( mcc == null || mcc.equals("null") || mcc.equals("")){
mcc = System.getProperty("MCC");
}
//mnc
//no special code for it @vishal
if( mnc == null || mnc.equals("null") || mnc.equals("")){
mnc = System.getProperty("MNC");
}
}
}
I will appreciate if someone let me know the reason why i am not able to get the value of LAC in case of nokia device.
Thanks
Peeyush

Reply With Quote

