×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    2

    Mobinfo APIs doubt

    I need to get the "Own Number" of the mobile device and thus have been using the Mobinfo APIs as my app has to support 2nd Ed devices too.
    I have implemented the Active Object and invoke the CMobileInfo::OwnNumber() API, but in the RunL() when the AO returns the status is always KErrNotSupported.
    Similar is seen when I try to fetch the IMSI info too...
    As per my understanding, on the emulator, the API should have returned a mock Own number. This is failing to happen and the return value is a Null.

    This behaviour is seen only on the emulator. I haven't tried my app on the device as yet and currently using the S60_2nd_FP2 (8.0a) SDK.

    Below is the Code:

    CMobileUtils* CMobileUtils::NewL()
    {
    CMobileUtils* self = new (ELeave) CMobileUtils();
    CleanupStack::PushL(self);
    self->ConstructL();
    CleanupStack::Pop(self);

    return self;
    }

    CMobileUtils::CMobileUtils() : CActive(EPriorityHigh)
    {

    }

    void CMobileUtils::ConstructL()
    {
    iMobileInfo = CMobileInfo::NewL();
    CActiveScheduler::Add(this); // Add to scheduler
    }

    CMobileUtils::~CMobileUtils()
    {
    Cancel(); // Cancel any request, if outstanding
    // Delete instance variables if any
    delete iMobileInfo;
    }

    void CMobileUtils::DoCancel()
    {
    switch(iPhoneInfoType)
    {
    case EHandsetIMSI:
    iMobileInfo->CancelGetIMSI(); //CMobInfo::
    break;
    case EHandsetOwnNumber:
    iMobileInfo->CancelGetOwnNumber(); //CMobInfo::
    break;
    default:
    break;
    }
    }

    void CMobileUtils::StartL()
    {
    Cancel(); // Cancel any request, just to be sure
    iState = EGetPhoneInfo;
    switch(iPhoneInfoType)
    {
    case EHandsetIMSI:
    {
    iMobileInfo->GetIMSI(iImsiNumber, iStatus); //CMobInfo::
    }
    break;
    case EHandsetOwnNumber:
    {
    iMobileInfo->GetOwnNumber(iOwnNumber, iStatus); //CMobInfo::
    }
    break;
    }

    SetActive(); // Tell scheduler a request is active
    iActiveSchedulerWait.Start();
    }

    void CMobileUtils::RunL()
    {
    iState = EDone;
    if ( iActiveSchedulerWait.IsStarted() )
    {
    iActiveSchedulerWait.AsyncStop();
    if(iStatus == KErrNone)
    {
    switch(iPhoneInfoType)
    {
    case EHandsetIMEI:

    break;
    case EHandsetIMSI:
    {
    //Successfully obtained
    //dummy Operation
    }
    break;
    case EHandsetOwnNumber:
    {
    //Successfully obtained
    //dummy Op
    }
    break;
    }
    }
    else if(KErrNotSupported)
    {
    // Error...
    //dummy
    }
    }
    }

    const TPtrC CMobileUtils::GetIMSI()
    {
    iPhoneInfoType = EHandsetIMSI;
    iImsiNumber.Zero();

    StartL();
    TPtrC ptr(iImsiNumber.Ptr());
    return ptr;
    }

    const TPtrC CMobileUtils::GetOwnNumber()
    {
    iPhoneInfoType = EHandsetOwnNumber;
    iOwnNumber.Zero();

    StartL();
    TPtrC ptr(iOwnNumber.Ptr());
    return ptr;
    }

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Mobinfo APIs doubt

    i think you can't find your own number but you can receive IMSI.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    2

    Re: Mobinfo APIs doubt

    Maybe true... But I am not able to retrieve the IMSI too with the MobInfo APIs. So was just wondering if there is something missing in the code!!

  4. #4
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: Mobinfo APIs doubt

    Maybe you must try in real device, because i have create application with mobinfo api, and i don't have any problem
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  5. #5
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Mobinfo APIs doubt

    your can find imsi using etelmm

    RMobilePhone::TMobilePhoneSubscriberId imsi;
    TRequestStatus status;
    phone.GetSubscriberId(status,imsi);
    User::WaitForRequest(status);
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  6. #6
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Mobinfo APIs doubt

    Hi,
    we can find the IMSI no. using the Mobinfo but there is a problem of fetching own number. If you want any help mail me I'll get back to you.
    Life is Short..... Live it with Positive Attitude...

Similar Threads

  1. upnp api's ?
    By morost in forum Symbian
    Replies: 2
    Last Post: 2007-06-08, 18:26
  2. Replies: 1
    Last Post: 2006-03-15, 05:36
  3. Java I-modeb APIs
    By irfan.khan in forum Mobile Java General
    Replies: 1
    Last Post: 2006-03-10, 13:51
  4. General Query on accessibility of APIs
    By jlewis666 in forum Mobile Java General
    Replies: 5
    Last Post: 2005-11-23, 20:04
  5. Audio Streaming APIs on 9210
    By Nokia_Archive in forum Symbian
    Replies: 1
    Last Post: 2002-05-30, 12:45

Posting Permissions

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