IAP query

This is a discussion on IAP query within the Symbian forums in Other Technologies category; 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 ...

Go Back   Application Development Forum > Other Technologies > Symbian

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-10-2008, 01:47 AM
saikrishna
Guest
 
Default IAP query

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}
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:13 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.