Discussion Board
Setting default APN for RealOne Player
2003-09-16, 17:05
#1
Registered User
Hi,
I'm writing an app that uses the RealOne Player to stream. By default there is no APN on the
phone suitable for streaming, so I've created one. However, I want to avoid the Default
Access Point menu when Real Player is called.
I have tried setting the phone's default apn, in the hopes that Real will use that, but I
don't seem to be able to manage it.
Using the iap id returned from CApDataHandler::CreateFromDataL, I have called
CApDataHandler::SetAsDefaultL and also tried inserting a new record in the comm db's
preference table. Both are giving me errors that I don't know how to solve. SetAsDefaultL
gives -6 (KErrArgument). InsertConnectionPreferenceL gives -1 (KErrNotFound). My code is
below.
I have also tried CCommsDatabase::SetGlobalSettingL( TPtrC(ASK_USER_BEFORE_DIAL), TFalse );
which I read somewhere would turn off the prompting for all connections, but it doesn't seem
to have had any effect.
Can anyone tell me how to remove the menu?
Thanks,
Sonia.
void myIAP::SetDefault(TUint32 iapId, CCommtestContainer* iContainer) const
{
CCommsDatabase* comDB=CCommsDatabase::NewL(EDatabaseTypeIAP);
CApDataHandler* ApDataHandler = CApDataHandler::NewLC(*comDB);
TRAPD(errorcode, ApDataHandler->SetAsDefaultL(iapId,EIspTypeInternetOnly));
// report error code (-6)
_LIT(KStr,"errorcode:");
TBuf16<50> str(KStr);
str.AppendNum(errorcode);
iContainer->iToDoLabel->SetTextL(str);
CleanupStack::PopAndDestroy();
delete comDB;
}
void myIAP::SetDefault2(TUint32 iapId, CCommtestContainer* iContainer) const
{
CCommsDatabase* comDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
CCommsDbConnectionPrefTableView* prefView = comDB->OpenConnectionPrefTableLC(ECommDbConnectionDirectionOutgoing);
// start creating new record
CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref aPref;
aPref.iRanking = 1; // I also tried 0
aPref.iDirection = ECommDbConnectionDirectionOutgoing;
aPref.iDialogPref = ECommDbDialogPrefDoNotPrompt;
CCommsDbConnectionPrefTableView::TCommDbIapBearer bearer;
bearer.iBearerSet = ECommDbBearerGPRS;
bearer.iIapId = iapId;
aPref.iBearer = bearer;
// insert it
TRAPD(errorcode, prefView->InsertConnectionPreferenceL(aPref));
// report error code (-1)
_LIT(KStr,"errorcode:");
TBuf16<50> str(KStr);
str.AppendNum(errorcode);
iContainer->iToDoLabel->SetTextL(str);
CleanupStack::PopAndDestroy();
delete comDB;
}
Re: Setting default APN for RealOne Player
2003-11-02, 21:10
#2
Registered User
Hi,
I am sorry, but the RealOne has the APN set in its own config file. So it is impossible to set it via some function calls. But it would be possible to modify this config file (it is a plain text file). But you would have to ensure that the RealOne is not running at the moment you make the modifications since this file is read only at the RealOne startup.
The file is placed in the c:\System\Data directory and I am not sure about its name but I think it is RealPlayer.ini (or RealPlayer.dat)
Regards,
Jan Vorlicek
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules