Beover1984(摇滚人生),问你关于CLogClient的问题。

wxzbz 2007-04-20 11:50:09
在S60的CallSummary这个例子CLogClient的事件即通话记录是在程序中加进去的,代码是:


void CAddEntries::ReadLogEventsL()
{
TResourceReader reader;
// An unnamed buffer is created for use by reader and is placed onto the Cleanup Stack.
CEikonEnv::Static()->CreateResourceReaderLC(reader, R_EVENT_LIST);

iNumberOfEntries = reader.ReadUint8();
for (TInt i = 0; i < iNumberOfEntries; i++)
{
// logEvent does not need to be added to the cleanup stack
// since the code called is leave-safe
CLogEvent* logEvent = CLogEvent::NewL();
logEvent->SetEventType(KLogCallEventTypeUid);
logEvent->SetDurationType(KLogDurationValid);
TInt direction = reader.ReadInt32();

TBuf<64> directionStr;
iLogClient.GetString(directionStr, direction);
logEvent->SetDirection(directionStr);

TLogDuration duration;
duration = reader.ReadUint32();
logEvent->SetDuration(duration);

TPtrC number = reader.ReadTPtrC();
logEvent->SetNumber(number);
TInt contactId = reader.ReadInt32();

if (contactId != KNullContactId)
{
// If we are setting a contact for our dummy entry we
// should make sure that there is a contact to be associated with.

// Returns the global Phonebook engine instance
CPbkContactEngine* pbkContactEngine = CPbkContactEngine::Static();
// create a new contact
CPbkContactItem* contactItem = pbkContactEngine->CreateEmptyContactL();
CleanupStack::PushL(contactItem);

// Find the phonenumber field of the contact, and add the telephone number to the contact
TPbkContactItemField* phoneNumber = contactItem->FindField(EPbkFieldIdPhoneNumberGeneral);
phoneNumber->TextStorage()->SetTextL(number);

// Add the new contact to the phonebook.
contactId = pbkContactEngine->AddNewContactL(*contactItem);
CleanupStack::PopAndDestroy(contactItem);
}

logEvent->SetContact(contactId);

TTime time;
time.HomeTime();
logEvent->SetTime(time);

// Ownership of logEvent is passed to iEventArray.
iEventArray.Append(logEvent);
}

CleanupStack::PopAndDestroy(); // Popping the buffer created for use by reader
}


void CAddEntries::ConstructL()
{
// Set the observers request status to pending
iObserverRequestStatus = KRequestPending;

// read dummy events from resource file
ReadLogEventsL();
iEntryAdded = 0;

// Issue a request to add the first event to the log
iLogClient.AddEvent(*(iEventArray[iEntryAdded]), iStatus);
CActiveScheduler::Add(this);
SetActive();
}





在uiq中,通话记录存在:"c:\system\data\Logdbu.dat"这个文件中。

我试了


RFs fs;
fs.Connect();
RFile file;

_LIT(KImsiFileName,"c:\\system\\data\\Logdbu.dat");
array->AppendL(KImsiFileName);

//TInt res = file.Open(fs,KImsiFileName,EFileShareReadersOnly|EFileStreamText);
TInt res = file.Open(fs,KImsiFileName,EFileShareAny);

if(res == KErrNone)
{
array->AppendL(_L("open file ok"));//一个用于显示的数组
file.Close();
fs.Close();
}
else
{
array->AppendL(_L("open file lost"));
}

文件无法打开,不论用那个打开模式都打不开。

那么我想问的关键问题是:
1、CLogClient要怎样打开通话记录的数据库或数据文件。是否SYMBIAN本来就不能打开系统保存的通话记录。
2、我现在的想法是,写一个程序一直运行着,监控系统通话的记录,然后生成自己的通话记录。这碰到的问题是如果电话打进来,如何判断那个电话是已接的,那个电话是没接的。
...全文
690 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
已拨电话、已接电话、未接来电是怎样区分的呢?
mahaoyun 2008-10-28
  • 打赏
  • 举报
回复
R_LOG_DIR_IN
R_LOG_DIR_OUT
R_LOG_DIR_MISSED

用iLogClient->GetString(direction, R_LOG_DIR_OUT);
这个可以得到所有的输出事件,不光是通话的记录,包括上网什么的信息,怎么做能使得到的数据只是电话的呢?
LXK_LQ 2008-10-24
  • 打赏
  • 举报
回复
已拨电话、已接电话、未接来电是怎样区分的呢?
mahaoyun 2008-10-21
  • 打赏
  • 举报
回复
希望能把解决方法贴出来,大家学习一下
Beover1984 2007-04-23
  • 打赏
  • 举报
回复
看楼主的问题已经解决了,希望能把解决方法贴出来.
wxzbz 2007-04-22
  • 打赏
  • 举报
回复
谢谢你 我已经在uiq的摸拟器上成功读出通话记录了,但有一个问题。我是把s60上的通话记录文件复制给uiq的摸拟器的。程序成功读出通话记录后,我在motorola m1000真机上试,还是读不出来。
发现了个现象
在摸拟器上
iLogClient->GetString(direction, R_LOG_DIR_IN);
direction 读出来是 “Incoming” (表示已找到有来电记录)

在真机上
iLogClient->GetString(direction, R_LOG_DIR_IN);
direction 读出来是 “口口”(这个有可能是参数不对,话机是有来电记录的)
因此在真机上没能找到相应的记录


同时,在此问一下,那位高手有m1000摸拟器。
Beover1984 2007-04-22
  • 打赏
  • 举报
回复
在UIQ上不能使用CLogClient吗?

3,120

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧