언어 설정

Menu
Sites
Language
E_System error in SearchMessageBoxN(

Hi all,

    can any one figure out the error in the below code 

SmsManager sm;
    int trc=0;
    SmsListener *sl=new SmsListener();
    sm.Construct(*sl);
    String res="";
    IList *mlist=sm.SearchMessageBoxN(SMS_MESSAGE_BOX_TYPE_ALL,&res,0,1,trc);
    result r=GetLastResult();
            if(r==E_SUCCESS)
            {
    SmsMessage* pSmsMessage = null;
    pSmsMessage = (SmsMessage*)mlist->GetAt(0);
    int msgid=pSmsMessage->GetId();
    String mdata=sm.GetFullText(msgid);
    AppLog("mdata is %ls",mdata.GetPointer());
    AppLog("at the end of backup sms");
            }
            else
            {
                AppLog("error");
            }

following priviliges added in the manifest file

messaging.read
messaging.write
application.launch

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

5 댓글
Alex Ashirov

Hi,

I have just tried your code snipped and SearchMessageBoxN() returns E_SUCCESS. Are you able to run MessageSender sample without errors?

Also, please note that my device flashed with 2.2.0.

Alex Dem

Hi,
I have checked on 2.2.1 device. I did not got E_System error too.
You could try check NativeApps-> Sample-> Message Sender also.
It could be usefull for your case(look at SendSmsMessage::SearchMessageBoxN there).
Also in your case all required privileges are listed (the same with Native example).
Alexey.

harish kumar kavali

Hi alexey
even in my Emulator & device  the the sample app is running fine, but my own app is returning E_System error
i dont know  why

 

harish kumar kavali

Hi,
My code working on device but not on emulator
but the sample app is working both on device & emulator
emulator version is 2.2.1
device version is 2.2.1

Alex Ashirov

Hi,

I have just tried this on emulator (SDK v.2.2.1). It works fine. GetLastResult() returns E_SUCCESS. You wrote before that you added appropriate privileges, but I noticed that sometimes IDE doesn't recognize privileges added manually and doesn’t re-build package. Probably you need to add them using Manifest editor if you added them manually.