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

Developer

Forums

Forums:

Hi ,

I am new to brew application.
I want to make a simple button in Brew (with button caption as "choose friend"), clicking on which take me to address book of user and when user selects any number from address book, then display that name selected by user as caption on that button.

Seen IDISPLAY_FrameButton(), but doesnt seems much of help.

Pls. let me know which API to use for making such button. Also if some code snippet is available it will be of great help.

Hi navneet
You can use IMenuCtl with class id AEECLSID_SOFTKEYCTL for making a button.
For Accessing address book use IAddrBook and IAddrRec interfaces. For more information go through the BREW api reference.

Hi navneet
You can use IMenuCtl with class id AEECLSID_SOFTKEYCTL for making a button.
For Accessing address book use IAddrBook and IAddrRec interfaces. For more information go through the BREW api reference.

Hi Prayag,
Thanks for the reply. I used th IMenuctl to create a menu.
Can you pls. provide the code snippet for creating records and accessing them using IAddrBook and IAddrRec interfaces. It will be of great help.
I am currently working on simulator.

Hi Prayag,
Thanks for the reply. I used th IMenuctl to create a menu.
Can you pls. provide the code snippet for creating records and accessing them using IAddrBook and IAddrRec interfaces. It will be of great help.
I am currently working on simulator.

AddrBook is OEM/device specific. Please check device pack for category/field support.
Adding record:
AEEAddrField aField[6];
IAddrRec *pIAddRec=NULL;
int nErr=0xffff;
aField[0].fID=AEE_ADDRFIELD_NAME;
aField[0].fType=AEEDB_FT_STRING;
aField[0].pBuffer=L"xyzaaa";
aField[0].wDataLen=(STRLEN("xyzaaa")+1)*2;
aField[1].fID=AEE_ADDRFIELD_PHONE_HOME;
aField[1].fType=AEEDB_FT_STRING;
aField[1].pBuffer=L"585858949494";
aField[1].wDataLen=(STRLEN("585858949494")+1)*2;
aField[2].fID=AEE_ADDRFIELD_PHONE_GENERIC;
aField[2].fType=AEEDB_FT_STRING;
aField[2].pBuffer=L"5858589494";
aField[2].wDataLen=(STRLEN("5858589494")+1)*2;
nErr=IADDRBOOK_EnumFieldsInfoInit(pMe->pIAddrBook,AEE_ADDR_CAT_NONE);
pIAddRec=IADDRBOOK_CreateRec(pMe->pIAddrBook,AEE_ADDR_CAT_NONE,aField,6);
if(!pIAddRec)
nErr=IADDRBOOK_GetLastError(pMe->pIAddrBook);
Accessing recods:
AEEAddrField *pAddrField;
int count,len,nErr;
count=IADDRBOOK_GetNumRecs(pMe->pIAddrBook);
count=IADDRREC_GetFieldCount(pMe->pIAddRec);
pAddrField=IADDRREC_GetField(pMe->pIAddRec,0);

AddrBook is OEM/device specific. Please check device pack for category/field support.
Adding record:
AEEAddrField aField[6];
IAddrRec *pIAddRec=NULL;
int nErr=0xffff;
aField[0].fID=AEE_ADDRFIELD_NAME;
aField[0].fType=AEEDB_FT_STRING;
aField[0].pBuffer=L"xyzaaa";
aField[0].wDataLen=(STRLEN("xyzaaa")+1)*2;
aField[1].fID=AEE_ADDRFIELD_PHONE_HOME;
aField[1].fType=AEEDB_FT_STRING;
aField[1].pBuffer=L"585858949494";
aField[1].wDataLen=(STRLEN("585858949494")+1)*2;
aField[2].fID=AEE_ADDRFIELD_PHONE_GENERIC;
aField[2].fType=AEEDB_FT_STRING;
aField[2].pBuffer=L"5858589494";
aField[2].wDataLen=(STRLEN("5858589494")+1)*2;
nErr=IADDRBOOK_EnumFieldsInfoInit(pMe->pIAddrBook,AEE_ADDR_CAT_NONE);
pIAddRec=IADDRBOOK_CreateRec(pMe->pIAddrBook,AEE_ADDR_CAT_NONE,aField,6);
if(!pIAddRec)
nErr=IADDRBOOK_GetLastError(pMe->pIAddrBook);
Accessing recods:
AEEAddrField *pAddrField;
int count,len,nErr;
count=IADDRBOOK_GetNumRecs(pMe->pIAddrBook);
count=IADDRREC_GetFieldCount(pMe->pIAddRec);
pAddrField=IADDRREC_GetField(pMe->pIAddRec,0);