Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 51
Registered: ‎08-25-2008
My Device: Not Specified
Accepted Solution

How to retrieve multiple email accounts from blackberry device programatically

Hello,

 

We can add upto 10 email accounts in a blackberrylike hotmail, gmail etc. I am developing an application in which I want the list of all the configured email accounts.

 

How can I retrieve it programatically?

 

Thanks in advance

Developer
Posts: 16,495
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to retrieve multiple email accounts from blackberry device programatically

ServiceBook sb = ServiceBook.getSB();
ServiceRecord[] sr = sb.getRecords();
Vector mailAddresses = new Vector();
for (int i = 0; i sr.length; i++) {
String address = new ServiceConfiguration(sr[i]).getEmailAddress();
if (address != null) {
mailAddresses.addElement(address);
}
}
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 51
Registered: ‎08-25-2008
My Device: Not Specified

Re: How to retrieve multiple email accounts from blackberry device programatically

Thanks lot for your quick responce