Fixing Motorol V3C / RAZR for address book IADDRBOOK_CreateRec () API | developer.brewmp.com Fixing Motorol V3C / RAZR for address book IADDRBOOK_CreateRec () API | developer.brewmp.com

Developer

Fixing Motorol V3C / RAZR for address book IADDRBOOK_CreateRec () API

Forums:

Can somebody tell me what is the right fix for Motorol V3C / RAZR for address book IADDRBOOK_CreateRec () API. I saw a thread saying

Since you're failing on IADDRBOOK_CreateRec, i think the problem might be you are adding to wrong address category...i too was facing problem on razr while adding record...try adding in AEE_ADDR_CAT_USER + 1...i think it should work....another thing is...check what field ID you are setting to the flield....c the data sheet or the simulator device details and set the correct filed....

thanks,
Srinivas

But this is still failing, I assume (AEE_ADDR_CAT_USER) / (AEE_ADDR_CAT_USER + 1) was suggested. But not sure about the FIELD ID. I have used standard AEE_ADDRFIELD_NAME,AEE_ADDRFIELD_PHONE_HOME,AEE_ADDRFIELD_PHONE_WORK,AEE_ADDRFIELD_PHONE_FAX,AEE_ADDRFIELD_EMAIL,AEE_ADDRFIELD_PHONE_CELL. All the data type are AEEDB_FT_STRING.

I get the error code as "AEE_ADDR_INVALID_FIELD_VALUE".

Anybody can give me insight to this.

Thanks
BRU

Hi,
If you just want to create(add) a new record on the phone addressbook,
just do the following... for more info check the respective API'S.
// Initialize the "AEEAddrField" data as below
AEEAddrField field[X]; // X= No of AEE_ADDRFIELD you required like AEE_ADDRFIELD_NAME,AEE_ADDRFIELD_PHONE_CELL......
field[0].fID = AEE_ADDRFIELD_NAME;
field[0].fType = AEEDB_FT_STRING;
STRTOWSTR(pMe->UserDataField2,aszName,60);
field[0].pBuffer= aszName;
field[0].wDataLen = (WSTRLEN(aszName)+1)*sizeof(AECHAR);
field[1].fID = AEE_ADDRFIELD_PHONE_CELL;
field[1].fType = AEEDB_FT_STRING;
STRTOWSTR(pMe->UserDataField2,aszName,60);
field[1].pBuffer= aszName;
field[1].wDataLen = (WSTRLEN(aszName)+1)*sizeof(AECHAR);
Soon-----------------------
// This will Initialize the Addressbook and search for the name that you have passed.
if(IADDRBOOK_EnumRecInit(pMe->pIAddrBook,AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, (void *)aszName, field[0].wDataLen)==AEE_SUCCESS)
{
The record is already exist with the name *** aszname ****
So check here the fields that you intead to add does exist's or not.

else // This will create the record with the fields you filled in the "AEEAddrField" in the data Structure....
pMe->pIAddrRec=IADDRBOOK_CreateRec(pMe->pIAddrBook,AEE_ADDR_CAT_NONE, (AEEAddrField*)field,X);
If you got any errors... Checks the errors using the following API's
IADDRBOOK_GetLastError(IAddrBook * pIAddrBook);
IADDRREC_GetLastError(IAddrRec * pIAddrRec);
See the errors code Description in the file AEEErrors.h of 3.x version.
Thanks all.
Ramki :)
-Why does life keep teaching me lessons..I have no desire to learn

Hi,
If you just want to create(add) a new record on the phone addressbook,
just do the following... for more info check the respective API'S.
// Initialize the "AEEAddrField" data as below
AEEAddrField field[X]; // X= No of AEE_ADDRFIELD you required like AEE_ADDRFIELD_NAME,AEE_ADDRFIELD_PHONE_CELL......
field[0].fID = AEE_ADDRFIELD_NAME;
field[0].fType = AEEDB_FT_STRING;
STRTOWSTR(pMe->UserDataField2,aszName,60);
field[0].pBuffer= aszName;
field[0].wDataLen = (WSTRLEN(aszName)+1)*sizeof(AECHAR);
field[1].fID = AEE_ADDRFIELD_PHONE_CELL;
field[1].fType = AEEDB_FT_STRING;
STRTOWSTR(pMe->UserDataField2,aszName,60);
field[1].pBuffer= aszName;
field[1].wDataLen = (WSTRLEN(aszName)+1)*sizeof(AECHAR);
Soon-----------------------
// This will Initialize the Addressbook and search for the name that you have passed.
if(IADDRBOOK_EnumRecInit(pMe->pIAddrBook,AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, (void *)aszName, field[0].wDataLen)==AEE_SUCCESS)
{
The record is already exist with the name *** aszname ****
So check here the fields that you intead to add does exist's or not.

else // This will create the record with the fields you filled in the "AEEAddrField" in the data Structure....
pMe->pIAddrRec=IADDRBOOK_CreateRec(pMe->pIAddrBook,AEE_ADDR_CAT_NONE, (AEEAddrField*)field,X);
If you got any errors... Checks the errors using the following API's
IADDRBOOK_GetLastError(IAddrBook * pIAddrBook);
IADDRREC_GetLastError(IAddrRec * pIAddrRec);
See the errors code Description in the file AEEErrors.h of 3.x version.
Thanks all.
Ramki :)
-Why does life keep teaching me lessons..I have no desire to learn

Hi Brewin,
Thanks for the reply.
Here is what I found and I could get this worked successfuly.
This RAZR handset needs
1."AEEDB_FT_PHONE" type for all the phone fields.
2."AEE_ADDR_CAT_NONE" was not handled by this , so AEE_ADDR_CAT_PERSONAL worked good. We can still use any supported category.
3.The last one is, that for any handset, we need to check the spec for supported field or we need try adding new contact and see what fields are displayed. Based on that we can have the code designed.
Thanks
Bru

Hi Brewin,
Thanks for the reply.
Here is what I found and I could get this worked successfuly.
This RAZR handset needs
1."AEEDB_FT_PHONE" type for all the phone fields.
2."AEE_ADDR_CAT_NONE" was not handled by this , so AEE_ADDR_CAT_PERSONAL worked good. We can still use any supported category.
3.The last one is, that for any handset, we need to check the spec for supported field or we need try adding new contact and see what fields are displayed. Based on that we can have the code designed.
Thanks
Bru

Hi bru,
Actually CATEGORY_NONE should work( As i don't have any problems with other handsets) Initially using this I succesfully created new record on RAZR but some reason it's not working now why i don't know.
Today I debug and found that MotoRAZR supports
only 4 categories(1- personel,2- Business,32769,32772). When I am creating the records with the above categories I am successfully adding a record on the handset. when i am trying to create a record with some other category like CATEGORY_NONE.... i am getting an ERROR - 8digit number which was not defined in the error.h file
So by using any of the four categories(1,2,32769,32772) you can successfully add record to the address book on MOTORAZR.
Thanks

Hi bru,
Actually CATEGORY_NONE should work( As i don't have any problems with other handsets) Initially using this I succesfully created new record on RAZR but some reason it's not working now why i don't know.
Today I debug and found that MotoRAZR supports
only 4 categories(1- personel,2- Business,32769,32772). When I am creating the records with the above categories I am successfully adding a record on the handset. when i am trying to create a record with some other category like CATEGORY_NONE.... i am getting an ERROR - 8digit number which was not defined in the error.h file
So by using any of the four categories(1,2,32769,32772) you can successfully add record to the address book on MOTORAZR.
Thanks

Even I thought AEE_ADDR_CAT_NONE is supported as per DDS, but I could never get that category created an record for MOTO RAZR. Let me know if you get this worked again sucess.
AEE_ADDR_CAT_USER+1 = 0x8000+1 = 32769. This is the user defined and This should not be a problem any time for 3.x handsets. But I am not sure about 32772(0x800A)
Thanks
BRU

Even I thought AEE_ADDR_CAT_NONE is supported as per DDS, but I could never get that category created an record for MOTO RAZR. Let me know if you get this worked again sucess.
AEE_ADDR_CAT_USER+1 = 0x8000+1 = 32769. This is the user defined and This should not be a problem any time for 3.x handsets. But I am not sure about 32772(0x800A)
Thanks
BRU

IADDRBOOK_CreateRec u have to use ..._cat_user+1 (or _personal or ets )to create record and it will work proper. u can also use cat_user but u will have a problem with editing data in your phone book

IADDRBOOK_CreateRec u have to use ..._cat_user+1 (or _personal or ets )to create record and it will work proper. u can also use cat_user but u will have a problem with editing data in your phone book