×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    104

    retrieval of cell id

    hello

    i have currently implemented the code using CTelephony class and i have implemented the asynchronous function using active objects. I ve used 'GetCurrentNetworkInfo' and 'CTelephony::TNetworkInfoV1 iNetinfo.iCellId' retrieved cell-id. i ve got cell id is 0 on emulator but am not being able to retrieve cell id on the device, and for testing i ve to wait for a cell-id change event. So i wanted to ask is there any synchronous function for retrieving the cell id.
    Last edited by saaa_persistent; 2009-03-09 at 16:25.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: retrieval of cell id

    Have you checked the capabilities needed for the API ?

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: retrieval of cell id

    Quote Originally Posted by saaa_persistent View Post
    hello

    i have currently implemented the code using CTelephony class and i have implemented the asynchronous function using active objects. I ve used 'GetCurrentNetworkInfo' and 'CTelephony::TNetworkInfoV1 iNetinfo.iCellId' retrieved cell-id. i ve got cell id is 0 on emulator but am not being able to retrieve cell id on the device, and for testing i ve to wait for a cell-id change event. So i wanted to ask is there any synchronous function for retrieving the cell id.
    There is no such synchronous API for getting such network parameters in public SDK. You can still use CTelephony API to get such parameters in synchronous way. Check this Wiki article which starts with danger note: Reading Network Paramters in 3rd edition -Synchronously

    Anyways, I hope you have SIM card in your phone and you are getting good reception of network signals, aren't you?
    Nokia Developer Wiki Moderation team

  4. #4
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    104

    Re: retrieval of cell id

    yes i have added the capabilities Location ReadDeviceData and ReadUserData required for retrieving the cell id. are there anymore required? and we have to just type the capabilities in the mmp file(next to the CAPABILITY keyword right?).

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: retrieval of cell id

    Quote Originally Posted by saaa_persistent View Post
    yes i have added the capabilities Location ReadDeviceData and ReadUserData required for retrieving the cell id. are there anymore required? and we have to just type the capabilities in the mmp file(next to the CAPABILITY keyword right?).
    Right. For getting CellId, ReadDeviceData will suffice the needs. You may need to clean and rebuild your project once you make any change in your .mmp file.
    Nokia Developer Wiki Moderation team

  6. #6
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    104

    Re: retrieval of cell id

    thanx a lot kiran for your quick reply. the link which you have given contains the code using active objects then how come it is synchronous? yes i re-built my project after making changes in .mmp file and for using Capability ReadDeviceData i signed my application using open signed online by giving the IMEI number. will that suffice?

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: retrieval of cell id

    Quote Originally Posted by saaa_persistent View Post
    thanx a lot kiran for your quick reply. the link which you have given contains the code using active objects then how come it is synchronous? yes i re-built my project after making changes in .mmp file and for using Capability ReadDeviceData i signed my application using open signed online by giving the IMEI number. will that suffice?
    Yes, OpenSigned Online process is fine when you are installing application on particular IMEI for development purpose. And Vinod has already elaborated more about how does synchronous work in his blog here: http://blogs.forum.nokia.com/index.p...articleId=421&

    I hope that helps.
    Nokia Developer Wiki Moderation team

  8. #8
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    104

    Re: retrieval of cell id

    hello
    thanx for your help. the GetCurrentNetworkInfo function returns on what event? i am using active objects and i have set active scheduler for this function. does it go in RunL() after getting the network information only?

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: retrieval of cell id

    Quote Originally Posted by saaa_persistent View Post
    hello
    thanx for your help. the GetCurrentNetworkInfo function returns on what event? i am using active objects and i have set active scheduler for this function. does it go in RunL() after getting the network information only?
    Briefly speaking, on the completion of GetCurrentNetworkInfo event, RunL will be called. See more on Wiki: Active Object
    Nokia Developer Wiki Moderation team

  10. #10
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    104

    Re: retrieval of cell id

    hello
    i wanted to ask when is the GetCurrentNetworkInfo event completed? Is it completed when we retrieve the network information?

  11. #11
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: retrieval of cell id

    Quote Originally Posted by saaa_persistent View Post
    hello
    i wanted to ask when is the GetCurrentNetworkInfo event completed? Is it completed when we retrieve the network information?
    Yes, that's how you get network parameters after calling GetCurrentNetworkInfo function.
    Nokia Developer Wiki Moderation team

  12. #12
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    104

    Re: retrieval of cell id

    thanx a lot kiran10182.
    are there any asynchronous functions available whose event gets completed when the cell-id gets changed?

  13. #13
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: retrieval of cell id

    Quote Originally Posted by saaa_persistent View Post
    thanx a lot kiran10182.
    are there any asynchronous functions available whose event gets completed when the cell-id gets changed?
    You can use NotifyChange() from CTelephony API and pass "ECurrentNetworkInfoChange" and instance of "TNetworkInfoV1Pckg".

    Check this example for reference: Monitoring battery status with CTelephony

    It is better if you use asynchronous way of getting Network parameters in conjunction with NotifyChange. So you need to work on the following examples:

    * http://wiki.forum.nokia.com/index.ph...ith_CTelephony
    * http://wiki.forum.nokia.com/index.ph...ith_CTelephony (For reference for NotifyChange)
    Nokia Developer Wiki Moderation team

  14. #14
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    104

    Re: retrieval of cell id

    thanx a lot for your help...
    i have typed the following code and it is giving me the error that '&' reference member 'iObserver' not initialized.

    i am giving the code.

    the header file is-

    #include <e32base.h>
    #include <Etel3rdParty.h>

    class CMyDBClass;

    class MCellIdObserver
    {
    public:
    virtual void CellIDL(TUint aCellId) = 0;
    };


    class CNetworkApp : public CActive
    {

    private:
    TBool iGettingNetworkInfo;
    void ConstructL();
    CTelephony* iTelephony;
    CTelephony::TNetworkInfoV1 iNetworkInfoV1;
    CTelephony::TNetworkInfoV1Pckg iNetworkInfoV1Pckg;

    public:
    void StartL1();
    static CNetworkApp* NewL(CMyDBClass *aMydb,MCellIdObserver& aObserver);
    CNetworkApp(CMyDBClass *aMydb,MCellIdObserver& aObserver);
    ~CNetworkApp();
    TInt iCellID;
    private:
    CMyDBClass *iMydb1;
    void RunL();
    void DoCancel();
    MCellIdObserver& iObserver1;

    };


    The cpp file is:-


    #include "network.h"
    #include <aknnotewrappers.h>
    #include "database.h"
    #include "vibration.h"

    CNetworkApp* CNetworkApp::NewL(CMyDBClass *aMydb,MCellIdObserver& aObserver)
    {
    CNetworkApp *self=new (ELeave) CNetworkApp(aMydb,aObserver);//(aView);
    CleanupStack::PushL(self);
    self->ConstructL();
    CleanupStack::Pop(self);
    return self;
    }
    CNetworkApp::CNetworkApp(CMyDBClass *aMydb,MCellIdObserver& aObserver):CActive(EPriorityStandard),iObserver1(aObserver),iNetworkInfoV1Pckg(iNetworkInfoV1)
    {
    iMydb1=aMydb;
    }

    void CNetworkApp::ConstructL()
    {
    iTelephony = CTelephony::NewL();
    CActiveScheduler::Add(this);
    }

    void CNetworkApp::StartL1()
    {

    iGettingNetworkInfo=ETrue;
    iTelephony->GetCurrentNetworkInfo(iStatus, iNetworkInfoV1Pckg);
    SetActive();

    }

    void CNetworkApp::RunL()
    {

    iObserver1.CellIDL(iNetworkInfoV1.iCellId);
    if(iStatus==KErrNone)
    {
    iTelephony->NotifyChange(iStatus,CTelephony::ECurrentNetworkInfoChange,iNetworkInfoV1Pckg);
    SetActive();
    }
    iGettingNetworkInfo=EFalse;
    }


    CNetworkApp::~CNetworkApp()
    {
    delete iTelephony;
    iTelephony = NULL;
    }

    void CNetworkApp:oCancel()
    {
    if(iGettingNetworkInfo)
    iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel);
    else
    iTelephony->CancelAsync(CTelephony::ECurrentNetworkInfoChangeCancel );
    }

    In appui.h i have declared a reference i of MCellIdObserver class and in ConstructL() function of AppUI.cpp i am calling the CNetworkApp::NewL(iMydb,iObserver) function passing the reference as parameter.

    AppUi.h file

    private:


    CMyDBClass* iMydb;
    MCellIdObserver& iObserver;


    AppUi.cpp file
    .
    .
    .
    .
    void CallAppUi::ConstructL()
    {
    // Initialise app UI with standard value.
    BaseConstructL(CAknAppUi::EAknEnableSkin);

    // Create view object
    iAppView = CallAppView::NewL(ClientRect() );
    // Create Database object
    iMydb=CMyDBClass::NewL();
    //Create CNetworlApp object
    iCellInfo=CNetworkApp::NewL(iMydb,iObserver);
    .
    .
    .
    .



    CallAppUi::CallAppUi() //giving error here that - '&' reference member 'iObserver' is not initialized
    {
    // No implementation required
    }

  15. #15
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: retrieval of cell id

    you should instead derive the Appui from MCellIdObserver, and them implement the interfce functions in your Appui.

Similar Threads

  1. Cell info retrieval
    By busko in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2009-01-16, 08:56
  2. cell id retrieval not working in N80 firmware version 5.0719.0.2
    By acar3 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-07-23, 09:35
  3. Cell info retrieval
    By busko in forum Symbian
    Replies: 4
    Last Post: 2003-06-10, 04:40
  4. Cell info retrieval
    By busko in forum General Development Questions
    Replies: 1
    Last Post: 2003-05-30, 13:46
  5. Cell info retrieval
    By busko in forum Mobile Java General
    Replies: 0
    Last Post: 2003-05-29, 11:06

Posting Permissions

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