×

Discussion Board

Results 1 to 3 of 3

Thread: SIM number

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    2

    SIM number

    How can I get back the number of my card SIM in JAVA?

    I found the function with C# but I didn't understund it?

    there is somebody who can help me?

    the function in c#:
    string num()
    {
    Tapi tapi = new Tapi();
    tapi.Initialize();

    Hashtable DeviceCaps;
    int deviceIDCell = -1;
    DeviceCaps = new Hashtable();
    string szPhoneNumber = "";

    for( int i = 0; i < tapi.NumDevices; i++ )
    {
    LINEDEVCAPS dc = new LINEDEVCAPS(1024);
    dc.Store();
    int dwVersion = tapi.NegotiateVersion(i);
    int ret = NativeTapi.lineGetDevCaps(tapi.hLineApp, i, dwVersion, 0, dc.Data);
    if ( ret < 0 )
    continue;
    if ( (LINEERR)ret == LINEERR.STRUCTURETOOSMALL )
    {
    dc.Data = new byte[dc.dwNeededSize];
    ret = NativeTapi.lineGetDevCaps(tapi.hLineApp, i, dwVersion, 0, dc.Data);
    }
    dc.Load();

    if (dc != null && dc.ProviderName == CellTSP.CELLTSP_PROVIDERINFO_STRING)
    {
    LINEADDRESSCAPS ac = new LINEADDRESSCAPS(1024);
    ac.Store();
    ret = NativeTapi.lineGetAddressCaps(tapi.hLineApp, i, 0, dwVersion, 0, ac.Data);
    ac.Load();
    szPhoneNumber = Encoding.Unicode.GetString(ac.Data, ac.dwAddressOffset, ac.dwAddressSize);

    ac = null;
    deviceIDCell = i;
    break;
    }


    }


    if (deviceIDCell == -1) // Not found
    MessageBox.Show("Could not find cellular line");

    tapi.Shutdown();
    return szPhoneNumber;
    }

  2. #2
    Regular Contributor
    Join Date
    Oct 2005
    Location
    Cairo,Egypt
    Posts
    72

    Re: SIM number

    Please read this post , you will find the reply of your Question
    http://discussion.forum.nokia.com/fo...ad.php?t=85660
    Wael Nabil
    Product Manager
    CITGlobal MOBiDIV
    Egypt.

  3. #3
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

Similar Threads

  1. Better SIM directory support
    By ovtchinnikov in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2006-03-29, 07:05
  2. WML & WMLSCript problem ????
    By gemini_shooter in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-14, 06:02
  3. WML & WMLSCript problem ????
    By gemini_shooter in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-14, 06:01
  4. SIM Serial Number or Handset Number
    By suneetshah in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-16, 17:53
  5. Personal
    By JSmith77 in forum PersonalJava
    Replies: 4
    Last Post: 2003-07-30, 12:52

Posting Permissions

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