在symbian第五版中在browser control中使用自己的接入点进行网络访问

KIS000738 - Setting access point ID for Browser Control Interface has no effect in S60 3rd Edition, Feature Pack 1

From Forum Nokia Wiki

 

 

ID KIS000738 Creation date August 31, 2007, updated January 9, 2008
Platform S60 3rd Edition, Feature Pack 1 Devices  
Category Symbian C++ Subcategory Nokia Web Browser

 

Keywords (APIs, classes, methods, functions):

Overview

Setting the access point ID for Browser Control Interface (CBrCtlInterface) does not have any effect in S60 3rd Edition, Feature Pack 1 devices.

Description

In S60 3rd Edition, the access point to be used for the Browser Control Interface can be set with

   iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsApId, apId );

After this, the access point with the specified ID (apId) will be used for the network connection automatically, without prompting the AP selection dialog.

In S60 3rd Edition, Feature Pack 1, a different Browser engine is used for Browser Control Interface. Calling the above function with a valid access point has no effect, and the access point selection dialog is shown every time when opening a URL using this API.

Solution

MBrCtlSpecialLoadObserver class has a virtual NetworkConnectionNeededL() member function that is called every time when a network connection is needed. A new class must be inherited from MBrCtlSpecialLoadObserver and this class has to implement its own network connection in the NetworkConnectionNeededL() function. The object of this user-implemented class can be passed as a parameter to CreateBrowserControlL() which creates the browser controller.

CMySpecialLoadObserver member variables

RSocketServ  iSocketServer;
RConnection  iConnection;
TBool        iFirstTime;  //Initial value should be ETrue
void CMySpecialLoadObserver::NetworkConnectionNeededL(
                                   TInt* aConnectionPtr,
                                   TInt* aSockSvrHandle,
                                   TBool* aNewConn,
                                   TApBearerType* aBearerType ) 
 {
 *aBearerType = EApBearerTypeAllBearers;
 
 if(iFirstTime) 
   {
   //New connection is established only once
   User::LeaveIfError(iSocketServer.Connect(KESockDefaultMessageSlots));
   User::LeaveIfError(iConnection.Open(iSocketServer, KConnectionTypeDefault));
   TCommDbConnPref prefs;
   prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
   prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
   prefs.SetIapId(2);	//preferred IAP 
   User::LeaveIfError(iConnection.Start(prefs));
   *aNewConn = ETrue;
   iFirstTime = EFalse; 
   }
 else
   {
   *aNewConn = EFalse;
   }
   
 *aConnectionPtr = reinterpret_cast<TInt>(&iConnection);
 *aSockSvrHandle = iSocketServer.Handle();
 return;
 }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值