| Reply | « Previous Thread | Next Thread » |
|
When I run this code by using emulator s40.Everything seems to be ok but when I put on my real mobile phone which is the same as my emulator (I using nokia6270), it shows "Security Exception" and I cannot add any ContactList. Can anyone help me how to solve this problem. If I put a catch(SecurityException) then it won't add contactlist to my mobile phone. What is the best solution to add my contact list on my mobile phone
Thank you Code:
final String VCard = "BEGIN:VCARD\r\n"+
"VERSION:3.0\r\n"+
"FN:12345678qwerty\r\n"+
"REV:2008-05-05\r\n"+
"TEL:111111\r\n"+
"UID:1.vcf\r\n"+
"END:VCARD\r\n";
// final String VCard = "swrgb";
PIMList list;
try {
list = PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
ByteArrayInputStream bais = new ByteArrayInputStream(VCard.getBytes());
DataInputStream dis = new DataInputStream(bais);
PIMItem[] items;
items = PIM.getInstance().fromSerialFormat(dis, "UTF-8");
Contact c = ((ContactList) list).createContact();
c = (Contact) items[0];
Contact contact = ((ContactList) list).importContact(c);
contact.commit();
} catch (PIMException ex) {
ex.printStackTrace();
} catch (UnsupportedEncodingException ex) {
ex.printStackTrace();
}
|
| pornchaispencer |
| View Public Profile |
| Find all posts by pornchaispencer |
|
Is your phone branded for some operator? if yes, which one?
Have you signed your MIDlet? Hartti |
|
Please check these steps:
1. Have you added API permissions to your jad files? 2. Have you signed your applications? 3. If so, Does you signature has enough authority to do such operation? |
|
Thank you, but can you tell me
How to add API permissions to my jad files? and How to sign my applications? Thank you for ur advices. |
| pornchaispencer |
| View Public Profile |
| Find all posts by pornchaispencer |
|
You may need to add following to your jad:
MIDlet-Permissions: javax.microedition.pim.ContactList.read, javax.microedition.pim.ContactList.write |
|
Join Date: Jul 2008
Posts: 329
Location: Faridabad(Delhi NCR)
ansh.chauhan
Offline
Regular Contributor
|
|
Please Signed ur midlet then go to Application(Midlet Setting) Property ...then Allow permission for accessing user read and write data...
Anshu Chauhan J2me Developer |
| ansh.chauhan |
| View Public Profile |
| Find all posts by ansh.chauhan |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Socket usage throws a security exception on Nokia devices. | tamboss2 | Mobile Java Networking & Messaging & Security | 4 | 2005-09-01 17:24 |
| security exception on datagram open despite signed midlet | dwigdor | Mobile Java Networking & Messaging & Security | 0 | 2005-08-22 01:21 |
| i got the Security Exception when i call the | madnan_java | Mobile Java General | 1 | 2004-10-06 13:13 |
| Security Exception on networking midlet using JSR-82 | jurthe | Mobile Java Networking & Messaging & Security | 0 | 2004-08-27 10:32 |
| Security Exception when I execute a MIDlet in Sun One | powercle | Mobile Java General | 0 | 2003-06-12 20:32 |