Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8830409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:04:49+00:00 2026-06-14T08:04:49+00:00

I have developed an app in J2me, using on Nokia X2 and c2-05. I

  • 0

I have developed an app in J2me, using on Nokia X2 and c2-05. I do access contacts from the database and write down in the memory, it was working fine until I used phone memory to write contacts, but Now I want to write contacts only to the SIM memory but it doesn’t. Although I can read from both SIM and Phone memory but can Only write to phone, while SIM doesn’t allow me, its strange. I mean either it should allow to read-write or it shouldn’t at all but it allows to read but not writing. Thanks

this is the code I am using

private class ContactWriter {

    private ContactList clist;
    public ContactWriter() throws PIMException {
        clist = (ContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.WRITE_ONLY, "SIM"); //or I used list[1] in my case its SIM, but still didn't get that!
    }

    public void close() throws PIMException {
        clist.close();
    }

    public void commitContact(ContactDTO contact) throws PIMException {

        Contact c = clist.createContact();
        String name[] = new String[clist.stringArraySize(Contact.NAME)];
        String addr[] = new String[clist.stringArraySize(Contact.ADDR)];

        if (contact.getName() != null) {

            if (clist.isSupportedField(Contact.NAME)) {
                boolean yes = false;
                if (clist.isSupportedArrayElement(Contact.NAME, Contact.NAME_GIVEN)) {
                    name[Contact.NAME_GIVEN] = contact.getName();
                    yes = true;
                } else if (clist.isSupportedArrayElement(Contact.NAME, Contact.NAME_OTHER)) {
                    name[Contact.NAME_OTHER] = contact.getName();
                    yes = true;
                } else if (clist.isSupportedArrayElement(Contact.NAME, Contact.NAME_FAMILY)) {
                    name[Contact.NAME_FAMILY] = contact.getName();
                    yes = true;
                }
                if (yes) {
                    c.addStringArray(Contact.NAME, Contact.ATTR_NONE, name);
                }
            } else if (clist.isSupportedField(Contact.FORMATTED_NAME)) {
                c.addString(Contact.FORMATTED_NAME, Contact.ATTR_NONE, contact.getName());
            }
        }

        if (contact.getAddress() != null) {
            if (clist.isSupportedField(Contact.ADDR)) {
                boolean yes = false;
                if (clist.isSupportedArrayElement(Contact.ADDR, Contact.ADDR_EXTRA)) {
                    addr[Contact.ADDR_EXTRA] = contact.getAddress();
                    yes = true;
                } else if (clist.isSupportedArrayElement(Contact.ADDR, Contact.ADDR_STREET)) {
                    addr[Contact.ADDR_STREET] = contact.getAddress();
                    yes = true;
                }
                if (yes) {
                    c.addStringArray(Contact.ADDR, Contact.ATTR_NONE, addr);
                }
            } else if (clist.isSupportedField(Contact.FORMATTED_ADDR)) {
                c.addString(Contact.FORMATTED_ADDR, Contact.ATTR_NONE, contact.getAddress());
            }
        }

        if (clist.isSupportedField(Contact.TEL)) {
            if ((clist.isSupportedAttribute(Contact.TEL, Contact.ATTR_HOME)) && (contact.getPhoneHome() != null)) {
                c.addString(Contact.TEL, Contact.ATTR_HOME, contact.getPhoneHome());
            }
            if ((clist.isSupportedAttribute(Contact.TEL, Contact.ATTR_MOBILE)) && (contact.getPhoneMobile() != null)) {
                c.addString(Contact.TEL, Contact.ATTR_MOBILE, contact.getPhoneMobile());
            }
            if ((clist.isSupportedAttribute(Contact.TEL, Contact.ATTR_WORK)) && (contact.getPhoneWork() != null)) {
                c.addString(Contact.TEL, Contact.ATTR_WORK, contact.getPhoneWork());
            }
            if ((clist.isSupportedAttribute(Contact.TEL, Contact.ATTR_PAGER)) && (contact.getPager() != null)) {
                c.addString(Contact.TEL, Contact.ATTR_PAGER, contact.getPager());
            }
        }

        if ((clist.isSupportedField(Contact.EMAIL)) && (contact.getEmail() != null)) {
            c.addString(Contact.EMAIL, Contact.ATTR_NONE, contact.getEmail());
        }

        if ((clist.isSupportedField(Contact.ORG)) && (contact.getOrganisation() != null)) {
            c.addString(Contact.ORG, Contact.ATTR_NONE, contact.getOrganisation());
        }

        c.commit();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:04:51+00:00Added an answer on June 14, 2026 at 8:04 am

    Its not possible to write contact on sim. Because sim is provided by the operator, so it may have compatibility issue when you write. Thats why j2me not allowed to write contacts on sim.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed my app using core data. It works fine in the simulator.
I have developed a web app using a webservice. Everything works fine in the
I have developed an app which requests permission from the user to access their
I have developed a J2ME app using java.awt.Window as I want a full screen
I have developed an app that in testing has worked fine but when it
I have developed a blackberry app, in which I am using Persistent Storage to
I have developed an app using Phonegap for Android and IPhone. Is there how
I have developed iphone app with working In App Purchase. Now I want to
I have developed an app and have been using Monkey to test it. My
i have developed an app that runs perfectly fine on the simulator but when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.