×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    2

    Location based services in Nokia series 60

    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

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Location based services in Nokia series 60

    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

Similar Threads

  1. Location Based Services - Location API - JSR179
    By aminuddin09 in forum Mobile Java General
    Replies: 9
    Last Post: 2011-02-23, 19:39
  2. Location based services
    By petr_kovar in forum Symbian
    Replies: 1
    Last Post: 2009-05-21, 02:13
  3. location based services...
    By mayankkedia in forum Mobile Java General
    Replies: 2
    Last Post: 2009-04-01, 08:37
  4. Location based services
    By underdream69 in forum Mobile Java General
    Replies: 8
    Last Post: 2006-10-19, 03:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •