|
| CApSelect classes very slow |
 |
Mon, 4 Sep 2006 12:55:04 +0200 |
Hello,
I've used some examples in the Internet to add access-point selection to my
application. It works well, but loading the APN list is very slow.
I load it when I create an access-point setting item, when opening my
settings view. It takes noticeable time - at least a second - when the phone
has about ten APNs configured, and I've checked my log and seen that opening
CApSelect and reading each line takes several hundred milliseconds.
I've tried reading all the APNs when starting the application, but this
makes startup time significantly longer...
I've also tried reading the APN list only when actually editing the setting
item; this basically works, but I keep the Iap Id in the app configuration
and I want to translate it into the Iap name. This takes almost as long as
loading the entire list...
The thing is, I've seen other applications which allow selecting an APN, and
in them this doesn't seem to take long at all.
Here is my code which accesses the ApSelect API (I've removed the text array
construction code to make this more readable):
void CApSettingItem::CompleteConstructionL()
{
m_pActiveApDb = CActiveApDb::NewL();
m_pActiveApDb->AddObserverL(this);
RefreshApListL();
}
void CApSettingItem::RefreshApListL()
{
CApSelect *pApSelect = CApSelect::NewLC(*m_pActiveApDb->Database(),
KEApIspTypeInternetOnly | KEApIspTypeInternetAndWAP,
EApBearerTypeAll,
KEApSortNameAscending);
CApUtils *pApUtils = CApUtils::NewLC(*m_pActiveApDb->Database());
TUint32 i, count = pApSelect->Count();
....
if(!pApSelect->MoveToFirst())
User::Leave(KErrGeneral);
for(i = 0; i < count; ++i) {
const TDesC &name = pApSelect->Name();
....
TUint32 iap_id = pApUtils->IapIdFromWapIdL(pApSelect->Uid());
if(i < count - 1)
if(!pApSelect->MoveNext())
User::Leave(KErrGeneral);
}
Am I doing something terribly wrong here?....
TIA
Uriah
|
| Post Reply
|
|
|
|
|
|
|
|
|
|