×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Oct 2004
    Location
    Singapore
    Posts
    36

    Question how to avoid HTTP Access point selection dialog

    I am writing a symbian program for series 60 which utilizes data transfer over HTTP. Every time I start the program it asks me to choose the access point manually.
    I will really appreciate it if some one could tell me how I can hard code the access point so that I don't have to manually select the access point.

  2. #2
    Registered User
    Join Date
    Nov 2004
    Posts
    5
    Hi,

    You will have to manually edit the comms db, follow these steps

    1. goto epoc32\wins\udeb and execute ceddump.exe, this should put a copy of the communications databse in your emulator c drive as "cedout.cfg".

    2.Edit this file and search for "Connectionpreferences" you will find something like this

    [ConnectionPreferences]
    ADD_SECTION
    Ranking=1
    Direction=OUTGOING
    DialogPref=PROMPT
    BearerSet=LAN
    IAP=1
    FIELD_COUNT=5
    END_ADD


    change the DialogPref to DONOTPROMPT, save the file and run "ced -i c:\cedout.cfg" from the same location as before, this will put the modified comms db. This should solve your problem.

    Cheers
    Umesh

  3. #3
    Registered User
    Join Date
    Oct 2004
    Location
    Singapore
    Posts
    36
    Hi Umesh

    Thanks for your help. It solves the problem in the emulator. However my objective is to avoid the "Select Access Point" dialog while running the program in my N6600 phone. I will really appreciate it if you could help me with it.

    Thanks once again.

    Jini

  4. #4
    Registered User
    Join Date
    Feb 2004
    Posts
    124
    Look at the Nokia iAPConnect program.

    There you can find how to connect.

    I think the best thing to do is to 1st
    launch a dialog. Then when you see the connect to be ok, you save the iap_id to a file.

    On subsequent starts you can use the id on the file to

    ...
    RConnection iConnect;
    RSocketServ iSocketServ;
    TCommDbConnPref iPref;
    ...
    rcode=iConnect.Stop();
    iPref.SetDirection(ECommDbConnectionDirectionOutgoing);
    iPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    iPref.SetIapId(aIapId);
    iPref.SetBearerSet(KCommDbBearerUnknown/*PSD*/);
    iConnect.Start(iPref);


    Yes. This is higly nontrivial thing to do.

    Another problem is that you cannot specify Rconnection to Http classes, however you can specify it to RSocket.Open and RHostResolver.Open ... The later is not documented but is found in the header file.

    There should be some hack to give it to the http classes, but I am not sure what it is. I'll add it here when i find it next time.

    My application does HTTP by RSocket in order to be S60v1 compatible, so I do not know about the HTTP classes.

    How to select access point initially:
    (Copied from IAPConnect example)..

    SelectAccessPointL(TUint32& aIap)
    {

    // Create Ap Settings Handler. See SDK Help for parameters.
    CApSettingsHandler* settingsHandler = CApSettingsHandler::NewLC(
    ETrue,
    EApSettingsSelListIsPopUp /*EApSettingsSelListIsListPane*/,
    EApSettingsSelMenuSelectNormal,
    /*KEApIspTypeInternetOnly*/ KEApIspTypeAll,
    /*EApBearerTypeGPRS*/ EApBearerTypeAll,
    KEApSortNameAscending);

    TUint32 originallyFocused(0);
    TUint32 aSelectedIap(0);

    // Show the dialog
    settingsHandler->RunSettingsL(originallyFocused, aSelectedIap);

    // Original value 0 is not valid IAP id, so failed if 0 after RunSettingsL().
    if (aSelectedIap)
    {
    CCommsDatabase* db = CCommsDatabase::NewL();
    CleanupStack::PushL(db);
    CApUtils* apUtils = CApUtils::NewLC(*db);
    // Convert IAP id to CommsDb id
    aIap = apUtils->IapIdFromWapIdL(aSelectedIap);
    CleanupStack::PopAndDestroy(2);
    }
    else
    {
    aIap = IAP_NONE;
    }

    CleanupStack::PopAndDestroy();
    }
    BTW:
    There is no point for using
    KEApIspTypeInternetOnly
    It will still give GPRS only and WAP only IAPS. One more documentd, but not implemented feature.
    Last edited by jkekoni; 2005-01-26 at 14:27.

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    124

    HERE IT GOES

    RHttpSession iSession;
    ...

    RStringPool stringPool = iSession.StringPool();


    RHTTPConnectionInfo connInfo = iSession.ConnectionInfo();

    connInfo.SetPropertyL(stringPool.StringF(HTTP::EHttpSocketServ,
    RHTTPSession::GetTable()), THTTPHdrVal(aSockServerHandle));

    connInfo.SetPropertyL(stringPool.StringF(HTTP::EHttpSocketConnection


    to avoid the RHTTPSession class from popping up a dialog to select
    connection.

    NOTE: I have not tested this myself.

    AUTHOR: Sammy <sammy@picostation.com>

    NOTE2: There is something missing from the last line. I do not know what it is, but SDK document may help...

    NOTE3: If you get this working, please reply it here.

  6. #6
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Helsinki
    Posts
    63
    See Symbian FAQ & Tech Tips, FAQ-1064
    "How do I set the connection preferences for the IAP to ensure I use my RConnection rather than a default one?"
    http://www3.symbian.com/faq.nsf/0/99...1?OpenDocument
    Last edited by jyrkiettila; 2006-04-13 at 12:34.

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    30

    What about launching Web Browser with an specific APN?

    Hi!
    I'm working with Series 80, Nokia 9500 Communicator, and trying to launch the web browser with a stablished RConnection.
    I reached to launch the APN I want without the "Select APN" dialog with the methods found here in the Nokia Forums, and that stuff works well (I've tested it mixing it with the sockets example). The problem is when I try to do next operation, which is to launch the browser. It seems previously stablished connection (I'm using RConnection) is not associated with the app browser and the device shows me the "Select APN" dialog.
    I reached to do this for other devices (series 60, UIQ...) and in fact, I'm using the UIQ version I had (which is Symbian 7.0 too), but at the moment I coundn't have any satisfactory result.
    Well, I think it should be a way to associate the connection I looked for with an app, say the System Browser, but I couldn't have any clue at the moment.
    Can you help me a bit, please?
    I think should be something related with PDP contexts, or multihoming, but I'll appreciate to hear some guiding words from you...

    Thanks a lot.

    Fran.

  8. #8
    Registered User
    Join Date
    Nov 2006
    Posts
    16

    Question Re: how to avoid HTTP Access point selection dialog

    HI ,
    I am also trying to implement http usin RConnection in sony ericsson UIQ devices p800 and p910, but RConnection in not recognised, so please help me what should I do ?

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: how to avoid HTTP Access point selection dialog

    What do you mean on "RConnection is not recognised"?

  10. #10
    Regular Contributor
    Join Date
    Mar 2006
    Location
    Bangalore
    Posts
    148

    Thumbs up Re: how to avoid HTTP Access point selection dialog

    Hi

    It is possible to specify an RConnection reference that the HTTP framework should use. check the following code.

    iHttpSocketServ.Connect(KESockDefaultMessageSlots);

    // Start the connection over the iSocketServer
    User::LeaveIfError(iHttpConnection.Open(iHttpSocketServ,KConnectionTypeDefault));

    // Now we can configure the http transaction to use this
    // IAP and Socket when making the connection

    TUint32 m_Iap=0;
    TCommDbConnPref commDbConnPref;
    commDbConnPref.SetIapId(m_Iap);
    commDbConnPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    commDbConnPref.SetDirection(ECommDbConnectionDirectionOutgoing);
    commDbConnPref.SetBearerSet( ECommDbBearerGPRS | ECommDbBearerWLAN | ECommDbBearerPAN | ECommDbBearerCdma2000 | ECommDbBearerLAN | ECommDbBearerCSD );
    User::LeaveIfError(iHttpConnection.Start(commDbConnPref));

    TRAPD(err,iHttpSession.OpenL());
    if( err != KErrNone )
    {
    // Most common error; no access point configured, and session creation
    // leaves with KErrNotFound.
    // Load a string from the resource file and add the error code to string
    User::Exit( err );
    }

    // Set the HTTP connection properties
    RStringPool strP = iHttpSession.StringPool();
    RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo();

    // RSocketServ Handle
    connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable() ), THTTPHdrVal (iHttpSocketServ.Handle()) );

    // RConnection Handle
    TInt connPtr = REINTERPRET_CAST(TInt, &(iHttpConnection));
    connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) );

    Regards,
    Pavan

  11. #11
    Registered User
    Join Date
    Jan 2007
    Location
    Italy
    Posts
    28

    Re: how to avoid HTTP Access point selection dialog

    This do not ask the IAP.
    My fixed name is "IBOX"


    Code:
    /*----------LANCIA IL LINKING ALLA RETE MEDIANTE IAP IBOX-------------------------*/
    TBool CSocketsEngine::NetLinkL(TCallInitiator aCaller)
    {
      TCommDbConnPref   Pref;
      CCommsDatabase    *CommDb;
      CCommsDbTableView *IapView;
      TInt     result;
      TUint    conncount;
      TUint32  IboxId=0;
      TBuf<80> STmp;
      TBool    Emulator= FALSE;
      TInetAddr LocAddr;
    
      /*----Initiate attempt to connect to a socket by IP address-------*/
      if( iEngineStatus==EGpDeadStop ) {
          iCallInitiator= aCaller;
          /*-----------------Apro IAP---------------------------------------------*/
          CommDb= CCommsDatabase::NewL(EDatabaseTypeIAP); // vuoto
          CleanupStack::PushL(CommDb) ;                   // da distruggere
          IapView= CommDb->OpenTableLC( TPtrC(IAP) );
          result= IapView->GotoFirstRecord();
          iIapName.Zero() ;
          while( result==KErrNone ) {
            IapView->ReadTextL( TPtrC(COMMDB_NAME), STmp) ;
            /*------emulatore->"NTRas GPRS" o "LAN_IAP_1"-------*/
            //Debug(STmp);
            if( STmp.Match(_L("IBOX")) != KErrNotFound ) {
                /*------trovato in lista----------------*/
                IapView->ReadUintL( TPtrC(COMMDB_ID), IboxId) ;
                iIapName.Copy(_L("IAP->(IBOX)")) ;
                break;
            }
            if( STmp.Match(_L("LAN_IAP_1")) != KErrNotFound ) {
                /*------trovato in lista----------------*/
                IapView->ReadUintL( TPtrC(COMMDB_ID), IboxId) ;
                iIapName.Copy(_L("IAP->(EMUL)")) ;
                Emulator= TRUE;
                break;
            }
            result= IapView->GotoNextRecord();
          }
          CleanupStack::PopAndDestroy(IapView);
          CleanupStack::PopAndDestroy(CommDb);
          /*---mostro IAP------------------*/
          Debug(iIapName);
          /*---------Per caso sono dentro all'emulatore?--------------------------*/
          if( Emulator ) {
              /*-----prendo indirizzo locale-------*/
              iLocalName.Copy(KDefaultEmulaName);
              //Debug(iLocalName);
              /*-----salto NetLinking--------------*/
              /*-----due passaggi in uno-----------*/
              ChangeStatus(EGpLinkedNoConn);
              if( iCallInitiator==IGpConnectCall ) {
                  /*---comincio da capo----*/
                  return ConnectL() ;
                }
                else { // IListenCall
                  return ListenL() ;
              }
          }
          /*---------Apro la connessione IAP per attivare il link GPRS------------*/
          iConnection.Open(iSocketServ);
          iConnection.EnumerateConnections(conncount);
          if( conncount !=0 ) {
              DebugToFile(_L("Eng-Just Linked !"));
              ChangeStatus(EGpLinkedNoConn);
              if( iCallInitiator==IGpConnectCall ) {
                  /*---comincio da capo----*/
                  return ConnectL() ;
                }
                else { // IListenCall
                  return ListenL() ;
              }
          }
          /*-----------------Sono proprio fuori-----------------------------------*/
          Pref.SetIapId(IboxId);
          Pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
          Pref.SetDirection(ECommDbConnectionDirectionOutgoing);
          iConnection.Start(Pref, iStatus);
          /*-----------------Cambio stato per RunL--------------------------------*/
          //Debug(_L("Deb-NetLinking !"));
          ChangeStatus(EGpNetLinking);
          /*-----------------Attivo evento timeout--------------------------------*/
          iTimer->After(KShortTO);
          /*-----------------Attivo evento completamento--------------------------*/
          SetActive();       // la Connection diventa pendente, attendi RunL
          return TRUE;
      }
      /*--fatto nulla--*/
      return FALSE;
    }

  12. #12
    Regular Contributor
    Join Date
    Jun 2005
    Posts
    52

    Re: how to avoid HTTP Access point selection dialog

    hi! thanks andreamobile. it really works, the IAP pop up dialog does not anymore appear..but the problem is in 6630, it crashes the application...

    can you help me on this matter please?

    thanks in advance!

  13. #13
    Regular Contributor
    Join Date
    Jun 2007
    Location
    INDIA
    Posts
    73

    Re: how to avoid HTTP Access point selection dialog

    Thanks AndreaMobile,

    With reference to u r code I am able to connect to require Access point.

    (Ofcourse using the listed profile).

    Thanks once again
    -Bytes




    Quote Originally Posted by AndreaMobile
    This do not ask the IAP.
    My fixed name is "IBOX"


    Code:
    /*----------LANCIA IL LINKING ALLA RETE MEDIANTE IAP IBOX-------------------------*/
    TBool CSocketsEngine::NetLinkL(TCallInitiator aCaller)
    {
      TCommDbConnPref   Pref;
      CCommsDatabase    *CommDb;
      CCommsDbTableView *IapView;
      TInt     result;
      TUint    conncount;
      TUint32  IboxId=0;
      TBuf<80> STmp;
      TBool    Emulator= FALSE;
      TInetAddr LocAddr;
    
      /*----Initiate attempt to connect to a socket by IP address-------*/
      if( iEngineStatus==EGpDeadStop ) {
          iCallInitiator= aCaller;
          /*-----------------Apro IAP---------------------------------------------*/
          CommDb= CCommsDatabase::NewL(EDatabaseTypeIAP); // vuoto
          CleanupStack::PushL(CommDb) ;                   // da distruggere
          IapView= CommDb->OpenTableLC( TPtrC(IAP) );
          result= IapView->GotoFirstRecord();
          iIapName.Zero() ;
          while( result==KErrNone ) {
            IapView->ReadTextL( TPtrC(COMMDB_NAME), STmp) ;
            /*------emulatore->"NTRas GPRS" o "LAN_IAP_1"-------*/
            //Debug(STmp);
            if( STmp.Match(_L("IBOX")) != KErrNotFound ) {
                /*------trovato in lista----------------*/
                IapView->ReadUintL( TPtrC(COMMDB_ID), IboxId) ;
                iIapName.Copy(_L("IAP->(IBOX)")) ;
                break;
            }
            if( STmp.Match(_L("LAN_IAP_1")) != KErrNotFound ) {
                /*------trovato in lista----------------*/
                IapView->ReadUintL( TPtrC(COMMDB_ID), IboxId) ;
                iIapName.Copy(_L("IAP->(EMUL)")) ;
                Emulator= TRUE;
                break;
            }
            result= IapView->GotoNextRecord();
          }
          CleanupStack::PopAndDestroy(IapView);
          CleanupStack::PopAndDestroy(CommDb);
          /*---mostro IAP------------------*/
          Debug(iIapName);
          /*---------Per caso sono dentro all'emulatore?--------------------------*/
          if( Emulator ) {
              /*-----prendo indirizzo locale-------*/
              iLocalName.Copy(KDefaultEmulaName);
              //Debug(iLocalName);
              /*-----salto NetLinking--------------*/
              /*-----due passaggi in uno-----------*/
              ChangeStatus(EGpLinkedNoConn);
              if( iCallInitiator==IGpConnectCall ) {
                  /*---comincio da capo----*/
                  return ConnectL() ;
                }
                else { // IListenCall
                  return ListenL() ;
              }
          }
          /*---------Apro la connessione IAP per attivare il link GPRS------------*/
          iConnection.Open(iSocketServ);
          iConnection.EnumerateConnections(conncount);
          if( conncount !=0 ) {
              DebugToFile(_L("Eng-Just Linked !"));
              ChangeStatus(EGpLinkedNoConn);
              if( iCallInitiator==IGpConnectCall ) {
                  /*---comincio da capo----*/
                  return ConnectL() ;
                }
                else { // IListenCall
                  return ListenL() ;
              }
          }
          /*-----------------Sono proprio fuori-----------------------------------*/
          Pref.SetIapId(IboxId);
          Pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
          Pref.SetDirection(ECommDbConnectionDirectionOutgoing);
          iConnection.Start(Pref, iStatus);
          /*-----------------Cambio stato per RunL--------------------------------*/
          //Debug(_L("Deb-NetLinking !"));
          ChangeStatus(EGpNetLinking);
          /*-----------------Attivo evento timeout--------------------------------*/
          iTimer->After(KShortTO);
          /*-----------------Attivo evento completamento--------------------------*/
          SetActive();       // la Connection diventa pendente, attendi RunL
          return TRUE;
      }
      /*--fatto nulla--*/
      return FALSE;
    }

Posting Permissions

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