add new contact's fields on Nokia Asha

21 views
Skip to first unread message

Denis Bt

unread,
Aug 24, 2015, 10:52:41 AM8/24/15
to CodenameOne Discussions
Hi there!

I'm developing an app for Nokia Asha and I've decided to use your great lib in the project. 
However, I experience some problem If I try to add new fields to contact.

Here some example:
        String id = ContactsManager.createContact("Denis", "Bt", "111111", "222222", "333333", "te...@g.com"); // it works perfect everywhery
        Contact cont = ContactsManager.getContactById(id);
       
        // it works only in simulator
        Hashtable emails = new Hashtable();
        emails.put("home", "ho...@g.com");
        emails.put("work", "wo...@g.com");
        emails.put("other", "ot...@g.com"); 
        emails.put("mobile", "mob...@g.com");
        
        cont.setPrimaryEmail("b...@g.com");

So, I can just create contacts with fields that are parameters in ContactsManager.createContact method.
I've checked the source of implementation javase and j2me ports and figured out why javase works when the simulator is running. 
Moreover, j2me port does nothing with methods from Contact class that have name starting with set...(example, setPrimaryEmail).
As I understood, I have to implement necessary functional for contacts with jsr75 PIM to add extra fields. Am I right?
Will you implement this functional for contacts in the future?

Thanks!

Shai Almog

unread,
Aug 25, 2015, 12:39:02 AM8/25/15
to CodenameOne Discussions
Hi,
the keys for the various entries (home, work etc.) are coded into the platform in a non-portable way.
Our create contact only allows adding a contact with one email. What you are doing there is changing a hashtable which has nothing to do with the contacts API.

If you need something specific to Asha you can use native interfaces and the platform specific JSR.

Denis Bt

unread,
Aug 25, 2015, 7:37:45 AM8/25/15
to CodenameOne Discussions
 Thanks Shai,

Ok, I get it.
I was just wondering what Setter methods from Contacts class can be used for?

Shai Almog

unread,
Aug 25, 2015, 12:19:05 PM8/25/15
to CodenameOne Discussions
They are there for our usage as the implementation creates the contact instance.
Reply all
Reply to author
Forward
0 new messages