Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi,How to retrive all data from address bokk and display it on screen of the emulator . If I think to store data say Name,phone,email what should I use IADDRESS Interface or IDATABASE Interface?

Regs
Pramod

Can anybody tell How will I refer my address book to retrieve data? How will I check I have a addressbook already there in the application,

Can anybody tell How will I refer my address book to retrieve data? How will I check I have a addressbook already there in the application,

Can anybody tell me how to display the records of the address books and how to retireve all the values???
Regards
Pramod

Can anybody tell me how to display the records of the address books and how to retireve all the values???
Regards
Pramod

hey samal yesterday the same concept i asked u...how to retrive the data, for that ithink u need to create .idx file(database file) where u store the data and read the data. how to achieve this process i'm still under confusion
well samal do u refer any book on BREW ?//?
regards
______
basha

hey samal yesterday the same concept i asked u...how to retrive the data, for that ithink u need to create .idx file(database file) where u store the data and read the data. how to achieve this process i'm still under confusion
well samal do u refer any book on BREW ?//?
regards
______
basha

Hi, Basha
As I said In the address book I dont have to create any .idx file. I am able to post data to my address book and even able to read the it back. since there is no help in IADDRESSBOOK Interface example in sdk1.1 to how to disp data, I could not able to perform it successfully.
Regs
Pramod

Hi, Basha
As I said In the address book I dont have to create any .idx file. I am able to post data to my address book and even able to read the it back. since there is no help in IADDRESSBOOK Interface example in sdk1.1 to how to disp data, I could not able to perform it successfully.
Regs
Pramod

What exactly are you trying to do? You can interact with the phone's native address book through the IAddrBook interface, but that is just a means of accessing data...any display operations will have to be performed using the appropriate API.

What exactly are you trying to do? You can interact with the phone's native address book through the IAddrBook interface, but that is just a means of accessing data...any display operations will have to be performed using the appropriate API.

I want to display the data of the address book ie, let us say the numbers/Name stored in the addressbook. Some how I am able to display the records. But I still have a problem here. First time it show me records. If I do come out of the applicaiton and relaunch the application, the emulator crashes while showing the records. I am using the code bellow to display the records
------------------------------------------------------------------------------------
Code :
------------------------------------------------------------------------------------
if (ISHELL_CreateInstance(Brg->a.m_pIShell,AEECLSID_ADDRBOOK,(void**)&Brg->myAdb )==SUCCESS)
{
if (Brg->myAdb)
{
reccount=IADDRBOOK_GetNumRecs(Brg->myAdb );
// Code fails bellow IADDRBOOK_EnumRecInit while second time running the application
result = IADDRBOOK_EnumRecInit(Brg->myAdb , AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, NULL, 0);
if (result==SUCCESS )
{
for(i=0;ipRec =IADDRBOOK_EnumNextRec(Brg->myAdb );
RecID=IADDRREC_GetRecID(Brg->pRec);
mFld=IADDRREC_GetField(Brg->pRec,0);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,1,szBuf); // Show Mobile Number
DBGPRINTF(szBuf); DBGPRINTF("Record ID Value=%d",RecID);
// Show Name
mFld=IADDRREC_GetField(Brg->pRec,1);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,2,szBuf);
DBGPRINTF(szBuf);
// Show Email
mFld=IADDRREC_GetField(Brg->pRec,2);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,3,szBuf);
DBGPRINTF(szBuf);

Could some body let me now the mistake I am doing
Regards
Pramod

I want to display the data of the address book ie, let us say the numbers/Name stored in the addressbook. Some how I am able to display the records. But I still have a problem here. First time it show me records. If I do come out of the applicaiton and relaunch the application, the emulator crashes while showing the records. I am using the code bellow to display the records
------------------------------------------------------------------------------------
Code :
------------------------------------------------------------------------------------
if (ISHELL_CreateInstance(Brg->a.m_pIShell,AEECLSID_ADDRBOOK,(void**)&Brg->myAdb )==SUCCESS)
{
if (Brg->myAdb)
{
reccount=IADDRBOOK_GetNumRecs(Brg->myAdb );
// Code fails bellow IADDRBOOK_EnumRecInit while second time running the application
result = IADDRBOOK_EnumRecInit(Brg->myAdb , AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, NULL, 0);
if (result==SUCCESS )
{
for(i=0;ipRec =IADDRBOOK_EnumNextRec(Brg->myAdb );
RecID=IADDRREC_GetRecID(Brg->pRec);
mFld=IADDRREC_GetField(Brg->pRec,0);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,1,szBuf); // Show Mobile Number
DBGPRINTF(szBuf); DBGPRINTF("Record ID Value=%d",RecID);
// Show Name
mFld=IADDRREC_GetField(Brg->pRec,1);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,2,szBuf);
DBGPRINTF(szBuf);
// Show Email
mFld=IADDRREC_GetField(Brg->pRec,2);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,3,szBuf);
DBGPRINTF(szBuf);

Could some body let me now the mistake I am doing
Regards
Pramod

It's a better idea to loop while IADDRBOOK_EnumNextRec() is returning valid records, or at least stick some error checking to make sure you're getting non-null pointers.

It's a better idea to loop while IADDRBOOK_EnumNextRec() is returning valid records, or at least stick some error checking to make sure you're getting non-null pointers.

Thanks Mohelndo,
I know what exactly the error is. My address record pointer is NULL, i.e Brg->pRec is NULL. But I want to know when the application runs first time, it is not null. But if I run the applicatio second time Brg->pRec is NULL. I want want to know why one second time this occurs?
Regards
Pramod

Thanks Mohelndo,
I know what exactly the error is. My address record pointer is NULL, i.e Brg->pRec is NULL. But I want to know when the application runs first time, it is not null. But if I run the applicatio second time Brg->pRec is NULL. I want want to know why one second time this occurs?
Regards
Pramod

Probably because the number of records in the address book doesn't match the number that are enumerated. Regardless, it's sloppy coding to omit error checking. Just use something like
while(NULL != IADDRBOOK_EnumNextRec(...))
{
...

Probably because the number of records in the address book doesn't match the number that are enumerated. Regardless, it's sloppy coding to omit error checking. Just use something like
while(NULL != IADDRBOOK_EnumNextRec(...))
{
...

OK I will try the way u suggest and get back to u. But I still have a doubt. If that is the case what u suggest, then it should crash at the first time
Regards
Pramod

OK I will try the way u suggest and get back to u. But I still have a doubt. If that is the case what u suggest, then it should crash at the first time
Regards
Pramod

Hi all
Anyone help me in using IAddrBook interface. I want to save the name in the AddressBook. I am using BREW 2.1.0 SDK. I have written the code. But its not working.
The code follows:
typedef enum
{
AB_RECORD_FIELD_NAME,
NUM_AB_RECORD_FIELDS
EABRecordFieldType;
boolean saveaddress(AECHAR * pText)
{
IAddrBook * m_pAddrBook = NULL;
IAddrRec* pRecord;
AEEAddrField pFieldArray[ NUM_AB_RECORD_FIELDS ];
pFieldArray[ AB_RECORD_FIELD_NAME ].fID = AEE_ADDRFIELD_NAME;
pFieldArray[ AB_RECORD_FIELD_NAME ].fType = AEEDB_FT_STRING;
pFieldArray[ AB_RECORD_FIELD_NAME ].wDataLen = WSTRSIZE( pText );
pFieldArray[ AB_RECORD_FIELD_NAME ].pBuffer = pText;
// Create a new record based on the AEEADDRField field array values
pRecord = IADDRBOOK_CreateRec( m_pAddrBook, AEE_ADDR_CAT_BUSINESS , pFieldArray, NUM_AB_RECORD_FIELDS ) ;
IADDRREC_Release ( pRecord );
return TRUE;

Is there any error in my code?
Thanks in Advance

Hi all
Anyone help me in using IAddrBook interface. I want to save the name in the AddressBook. I am using BREW 2.1.0 SDK. I have written the code. But its not working.
The code follows:
typedef enum
{
AB_RECORD_FIELD_NAME,
NUM_AB_RECORD_FIELDS
EABRecordFieldType;
boolean saveaddress(AECHAR * pText)
{
IAddrBook * m_pAddrBook = NULL;
IAddrRec* pRecord;
AEEAddrField pFieldArray[ NUM_AB_RECORD_FIELDS ];
pFieldArray[ AB_RECORD_FIELD_NAME ].fID = AEE_ADDRFIELD_NAME;
pFieldArray[ AB_RECORD_FIELD_NAME ].fType = AEEDB_FT_STRING;
pFieldArray[ AB_RECORD_FIELD_NAME ].wDataLen = WSTRSIZE( pText );
pFieldArray[ AB_RECORD_FIELD_NAME ].pBuffer = pText;
// Create a new record based on the AEEADDRField field array values
pRecord = IADDRBOOK_CreateRec( m_pAddrBook, AEE_ADDR_CAT_BUSINESS , pFieldArray, NUM_AB_RECORD_FIELDS ) ;
IADDRREC_Release ( pRecord );
return TRUE;

Is there any error in my code?
Thanks in Advance

hi priya!
where is the stroing is taken palce to load dynamically the names and string.....
check it properly. well what output ur getting let me know
regards
//basha//

hi priya!
where is the stroing is taken palce to load dynamically the names and string.....
check it properly. well what output ur getting let me know
regards
//basha//

mean while post the code in quotes it makes lot of confusion with out quotes
//basha//

mean while post the code in quotes it makes lot of confusion with out quotes
//basha//

Hi all,
I should store the name in the addressbook using IAddrBook_CreateRec() method. Help me out in writing the code......
priya

Hi all,
I should store the name in the addressbook using IAddrBook_CreateRec() method. Help me out in writing the code......
priya

Hi
How to store the Name in the native address book? I am using BREW 2.1.0. Help me in writing the code.
Thanks in advance
Priya

Hi
How to store the Name in the native address book? I am using BREW 2.1.0. Help me in writing the code.
Thanks in advance
Priya

Check out the AddrBook example in the 1.1 SDK.

Check out the AddrBook example in the 1.1 SDK.

I am using BREW SDK 2.1.0
Priya

I am using BREW SDK 2.1.0
Priya

Well then I guess you'll have to download the 1.1 SDK to get the examples.

Well then I guess you'll have to download the 1.1 SDK to get the examples.

Thanks a lot. I have downloaded the SDK 1.1. The examples were quite useful for me. I have inserted the data in the addressbook and can get the number of records stored in the addressbook.
Priya

Thanks a lot. I have downloaded the SDK 1.1. The examples were quite useful for me. I have inserted the data in the addressbook and can get the number of records stored in the addressbook.
Priya

HI Pramod,
I am new to BREW, I also looking for the same thing,
could you please tell me where you got the Brg->myAds ?
Thanks
Ramesh
samalPramod wrote:I want to display the data of the address book ie, let us say the numbers/Name stored in the addressbook. Some how I am able to display the records. But I still have a problem here. First time it show me records. If I do come out of the applicaiton and relaunch the application, the emulator crashes while showing the records. I am using the code bellow to display the records
------------------------------------------------------------------------------------
Code :
------------------------------------------------------------------------------------
if (ISHELL_CreateInstance(Brg->a.m_pIShell,AEECLSID_ADDRBOOK,(void**)&Brg->myAdb )==SUCCESS)
{
if (Brg->myAdb)
{
reccount=IADDRBOOK_GetNumRecs(Brg->myAdb );
// Code fails bellow IADDRBOOK_EnumRecInit while second time running the application
result = IADDRBOOK_EnumRecInit(Brg->myAdb , AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, NULL, 0);
if (result==SUCCESS )
{
for(i=0;ipRec =IADDRBOOK_EnumNextRec(Brg->myAdb );
RecID=IADDRREC_GetRecID(Brg->pRec);
mFld=IADDRREC_GetField(Brg->pRec,0);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,1,szBuf); // Show Mobile Number
DBGPRINTF(szBuf); DBGPRINTF("Record ID Value=%d",RecID);
// Show Name
mFld=IADDRREC_GetField(Brg->pRec,1);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,2,szBuf);
DBGPRINTF(szBuf);
// Show Email
mFld=IADDRREC_GetField(Brg->pRec,2);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,3,szBuf);
DBGPRINTF(szBuf);

Could some body let me now the mistake I am doing
Regards
Pramod

HI Pramod,
I am new to BREW, I also looking for the same thing,
could you please tell me where you got the Brg->myAds ?
Thanks
Ramesh
samalPramod wrote:I want to display the data of the address book ie, let us say the numbers/Name stored in the addressbook. Some how I am able to display the records. But I still have a problem here. First time it show me records. If I do come out of the applicaiton and relaunch the application, the emulator crashes while showing the records. I am using the code bellow to display the records
------------------------------------------------------------------------------------
Code :
------------------------------------------------------------------------------------
if (ISHELL_CreateInstance(Brg->a.m_pIShell,AEECLSID_ADDRBOOK,(void**)&Brg->myAdb )==SUCCESS)
{
if (Brg->myAdb)
{
reccount=IADDRBOOK_GetNumRecs(Brg->myAdb );
// Code fails bellow IADDRBOOK_EnumRecInit while second time running the application
result = IADDRBOOK_EnumRecInit(Brg->myAdb , AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, NULL, 0);
if (result==SUCCESS )
{
for(i=0;ipRec =IADDRBOOK_EnumNextRec(Brg->myAdb );
RecID=IADDRREC_GetRecID(Brg->pRec);
mFld=IADDRREC_GetField(Brg->pRec,0);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,1,szBuf); // Show Mobile Number
DBGPRINTF(szBuf); DBGPRINTF("Record ID Value=%d",RecID);
// Show Name
mFld=IADDRREC_GetField(Brg->pRec,1);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,2,szBuf);
DBGPRINTF(szBuf);
// Show Email
mFld=IADDRREC_GetField(Brg->pRec,2);
WSTR_TO_STR((AECHAR*)mFld->pBuffer,szBuf,sizeof(szBuf));
DisplayOutput(Brg,3,szBuf);
DBGPRINTF(szBuf);

Could some body let me now the mistake I am doing
Regards
Pramod

Hi,
I am using BREW 3.1 SDK, I want to read the data from the phone Address book, and display in the screen.
I have writen some code, But i am not able to display in the screen.
The code is below.
case ADDRBK_ENUM_READ:
{
IAddrBook *pb;
IAddrRec *pR;
int nCount,result,i;
AEEAddrField *field;
AECHAR szBuf[100];
int RecID;
STRCPY(szName,"My BREW");
STRTOWSTR(szName,aszName,60);
if(!ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_ADDRBOOK, (void **)&pb))
{
nCount=IADDRBOOK_GetNumRecs(pb);
result = IADDRBOOK_EnumRecInit(pb , AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, NULL, 0);
if (result==SUCCESS )
{
for( i=0;ipBuffer,szBuf,sizeof(szBuf));
DisplayOutput(pb,0,szBuf);
}
}
}
else
DisplayOutput (pme, -1, "Could not create IAddrBook");
}
Regards
Ramesh

Hi,
I am using BREW 3.1 SDK, I want to read the data from the phone Address book, and display in the screen.
I have writen some code, But i am not able to display in the screen.
The code is below.
case ADDRBK_ENUM_READ:
{
IAddrBook *pb;
IAddrRec *pR;
int nCount,result,i;
AEEAddrField *field;
AECHAR szBuf[100];
int RecID;
STRCPY(szName,"My BREW");
STRTOWSTR(szName,aszName,60);
if(!ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_ADDRBOOK, (void **)&pb))
{
nCount=IADDRBOOK_GetNumRecs(pb);
result = IADDRBOOK_EnumRecInit(pb , AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, NULL, 0);
if (result==SUCCESS )
{
for( i=0;ipBuffer,szBuf,sizeof(szBuf));
DisplayOutput(pb,0,szBuf);
}
}
}
else
DisplayOutput (pme, -1, "Could not create IAddrBook");
}
Regards
Ramesh