×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor
    Join Date
    Oct 2009
    Posts
    314

    Problem with the Http part

    Hi

    I have an application which connects to the server for downloading some data. Now whenever I start the application it ask for the access point.

    Now just for the knowledge I want to know whether is it possible that the application ask the access point just for once and through out the longivity of the application whenever I start the application the access point is no asked.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Posts
    22

    how to set default access point

    hello when ever my application connects with server...it asks for default access point....then we should give the default access point every time so is there any way to set the default access point??????? if so how to do it??????? thanks for any replies....

  3. #3
    Regular Contributor
    Join Date
    Oct 2009
    Posts
    314

    Re: how to set default access point

    That is my question. I need an answer to that. Is there a way to store that access point so that whenever the app starts it will take that acess point only

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    27

    Re: Problem with the Http part

    If you have the old IAP number from previous runs stored, you can set up your RConnection as follows:

    TCommDbConnPref prefs;
    if (iConnMgr.IapIdSet()) // iConnectionManager stores the IAP ID between runs, use your own mechanism here
    {
    prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
    prefs.SetIapId(iConnMgr.IapId());
    }
    CLog::Static().Log(_L8("Start connection"), CLog::EHttpRequest);
    iConnection.Start(prefs, iStatus);

  5. #5
    Regular Contributor
    Join Date
    Oct 2009
    Posts
    314

    Re: Problem with the Http part

    Thanks for your reply but can you let me know how to store the acess point for the first time so that I can use it according to the code you have shown

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    27

    Re: Problem with the Http part

    The following code will create a connection for the express purpose of bringing up the IAP select dialog so the user can set which IAP they want to use. You can then take the IAP ID and store it however you like:

    RConnection connection;
    RSocketServ server;
    User::LeaveIfError(server.Connect());
    CleanupClosePushL(server);
    User::LeaveIfError(connection.Open(server));
    CleanupClosePushL(connection);
    TCommDbConnPref prefs;
    prefs.SetDialogPreference(ECommDbDialogPrefPrompt); //This forces the IAP Select dialog
    prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
    connection.Start(prefs);
    User::LeaveIfError(connection.GetIntSetting(KIapIdSetting, iIAPId)); // On return, iIAPId will be set to the appropriate IAP ID. Store it for future use.
    CleanupStack::PopAndDestroy(2,&server);//server, connection

  7. #7
    Regular Contributor
    Join Date
    Oct 2009
    Posts
    314

    Re: Problem with the Http part

    Thanks for your reply again. Can you let me know what is the type of IAPId and what need to be KIapIdSetting

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Problem with the Http part

    You can check the method GetIntSetting in the SDK Help, to find out the types.
    Also search for GetIntSetting in the Wiki, that tells even more.

  9. #9
    Regular Contributor
    Join Date
    Oct 2009
    Posts
    314

    Re: Problem with the Http part

    Hi I have some problem regarding understanding of the code. Please help me in knowing what is the type for iConnMgr. And how will it help in storing the IAP ID between runs. What can be the mechanism

  10. #10
    Registered User
    Join Date
    Apr 2008
    Posts
    27

    Re: Problem with the Http part

    iConnMgr is an internal class from my project, so it won't be of any use to you. The IAP ID is a simple TUint32 so serialising doesn't need anything clever. If you don't have any persistant settings in your app yet, simply read and write the integer to a file. RFile for file access, TDes::AppendNum() to encode the int into a descriptor for writing via RFile, TLex::Val() for parsing the value back out of a descriptor read from the file.

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Problem with the Http part

    That is the place where you have to put your own mechanism:
    As IapIdSet() appears in an if, it is simply the place where you have to decide if you already have a stored IAP ID, or not. And IapId() would provide its actual value.

    EDIT: sorry, apparently this thread was open in my browser for a long time.

  12. #12
    Registered User
    Join Date
    Nov 2010
    Posts
    22

    Re: Problem with the Http part

    Quote Originally Posted by wizard_hu_ View Post
    That is the place where you have to put your own mechanism:
    As IapIdSet() appears in an if, it is simply the place where you have to decide if you already have a stored IAP ID, or not. And IapId() would provide its actual value.

    EDIT: sorry, apparently this thread was open in my browser for a long time.
    yes wizard u r rte.... tats all clear but need to know whn the default access point is asked to the user is there any call back function in it???? n after the user pressed the access point how the selected access point is used??? i tried to find tat by debugging but i couldn't find tat exactly wre it happens????
    as i seen
    TInt iapRet = settings->RunSettingsL(0, iSelectedIap);
    this asks for default access point should we proceed the code here?/????
    after tat only we can use those code u specified in tat am i rte???... hope so me too facing the same problem as said in #2...... thanks for any replies....
    Last edited by johnson30; 2010-12-08 at 14:36.

  13. #13
    Registered User
    Join Date
    Nov 2010
    Posts
    22

    Re: Problem with the Http part

    actually i read through the CAPsettingHandler class

    in tat they have said the following line

    It is also possible to start the UI
    * without selection, so if any module has a 'linked/default/etc.'
    * access point and stored it's UID, the module can simply call the
    * editor part of the UI without having to select the AP once more.
    * In case of editing only, (aStartWithSelection is EFalse), all other
    * construction parameters are ignored and after construction caller can
    * simply call RunSettingsL(..).
    so need to know how to store our default access point in tat linked/default/etc ?????
    thanks for any replies.........

  14. #14
    Regular Contributor
    Join Date
    Oct 2009
    Posts
    314

    Re: Problem with the Http part

    Quote Originally Posted by agray View Post
    iConnMgr is an internal class from my project, so it won't be of any use to you. The IAP ID is a simple TUint32 so serialising doesn't need anything clever. If you don't have any persistant settings in your app yet, simply read and write the integer to a file. RFile for file access, TDes::AppendNum() to encode the int into a descriptor for writing via RFile, TLex::Val() for parsing the value back out of a descriptor read from the file.
    I have done that and now it is working the way I expected. The access point is asked just for once ... Now there is again a problem. What I did is like for the first time when the app asks for the access point and i select that , I use to store that in a file and use it for the next times as we have discussed so far. But if assume I am using Wi-Fi and I started the app for the first time I selected one Wi-Fi point and started the app.

    Now I move out of the range of that particular Wi-Fi to a new one. But when I will start my app for the second time it will take the IAP stored in the file only and will call the

    iConnection.Start(prefs); but ultimately though it will open the app but the access point wont be working. How will I handle that. Now it seemsStart is an asynchronous function so it must have some Complete indicative function where I can handle this err and again select another Wi-Fi if the first one is not working.

    Can anyone suggest some way .

  15. #15
    Registered User
    Join Date
    Nov 2010
    Posts
    22

    Re: Problem with the Http part

    Quote Originally Posted by vicky_nits View Post
    I have done that and now it is working the way I expected. The access point is asked just for once ... Now there is again a problem. What I did is like for the first time when the app asks for the access point and i select that , I use to store that in a file and use it for the next times as we have discussed so far. But if assume I am using Wi-Fi and I started the app for the first time I selected one Wi-Fi point and started the app.

    Now I move out of the range of that particular Wi-Fi to a new one. But when I will start my app for the second time it will take the IAP stored in the file only and will call the

    iConnection.Start(prefs); but ultimately though it will open the app but the access point wont be working. How will I handle that. Now it seemsStart is an asynchronous function so it must have some Complete indicative function where I can handle this err and again select another Wi-Fi if the first one is not working.

    Can anyone suggest some way .
    hello vicky_nits can u plz share ur code here...

Similar Threads

  1. How can I set the best one access point as default
    By zzcdyx in forum [Archived] Qt Mobility Project
    Replies: 9
    Last Post: 2011-12-22, 08:46
  2. Replies: 2
    Last Post: 2010-08-18, 22:55
  3. How to set default access point N70?
    By alphanet in forum General Development Questions
    Replies: 2
    Last Post: 2010-03-08, 17:19
  4. Set Default Access Point
    By Patois in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2009-08-31, 19:01

Posting Permissions

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