| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi all, I am developing an application (S60 3rd edition)which will upload some data= from mobile phone to server using GPRS at regular intervals. I am using th= e HTTP APIs available in symbian. Now i am trying to automatically set the = IAP during the beginning of the first transaction (GET/POST) and use that f= or successive transactions. This application runs in the background when st= arted so i cant allow the user to choose the correct IAP for GPRS. In some = of the previous posts i have found the following code ---------------------------------------------------------------------------= ------------------------ {noformat}User::LeaveIfError(iSocketServ.Connect() ); User::LeaveIfError(iConnection.Open(iSocketServ)); =20 // open the IAP communications database=20 CCommsDatabase* commDB =3D CCommsDatabase::NewL(EDatabaseTypeIAP); CleanupStack::PushL(commDB); =09// initialize a view=20 CCommsDbConnectionPrefTableView* commDBView =3D=20 commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbCo nnectionDirectionU= nknown); =09// go to the first record=20 User::LeaveIfError(commDBView->GotoFirstRecord()); =09// Declare a prefTableView Object. CCommsDbConnectionPrefTableView::TCommDbIapConnect ionPref pref; =09// read the connection preferences=20 commDBView->ReadConnectionPreferenceL(pref); TUint32 iapID =3D pref.iBearer.iIapId;=20 =09// pop and destroy the IAP View=20 CleanupStack::PopAndDestroy(commDBView); =09// pop and destroy the database object CleanupStack::PopAndDestroy(commDB); =09// Now we have the iap Id. Use it to connect for the connection. =09// Create a connection preference variable. TCommDbConnPref connectPref; =09// setup preferences=20 connectPref.SetDialogPreference(ECommDbDialogPrefD oNotPrompt); connectPref.SetDirection(ECommDbConnectionDirectio nUnknown); connectPref.SetBearerSet(ECommDbBearerGPRS); =09//Sets the CommDb ID of the IAP to use for this connection connectPref.SetIapId(iapID); =20 User::LeaveIfError(iConnection.Start(connectPref)) ; =09 //set the sessions connection info RStringPool strPool =3D iSession.StringPool(); RHTTPConnectionInfo connInfo =3D iSession.ConnectionInfo(); =20 //to use our socket server and connection connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable() ), THTTPHdrVal (iSocketServ.Handle()) ); connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ),=20 THTTPHdrVal (REINTERPRET_CAST(TInt, &(iConnection))) ); ---------------------------------------------------------------------------= - I think this code checks the connectionpreference table and takes the first= record. In this regard i have a few queries. 1. Will this code always fetch me the correct IAP for GPRS. Is there any po= ssibility the the IAP that is fetched is currently not working=20 2. Suppose i use a SIM taken from one service provider(GPRS activated). Usi= ng the service message i configure the GPRS access point. Then i run my app= lication. Then i close my application and change the SIM and put a sim card= of another service provider. Using service message i configure my new IAP for GPRS and again run my = application. Will my application be still be able to choose the correct IAP= for GPRS?? thanks and regards, Krishna {noformat} |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.