wasim-h-sheikh / vcardio

Automatically exported from code.google.com/p/vcardio
0 stars 0 forks source link

while writing vcard getting error in Android, As a normar Java program its working fine. #81

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Using Vcard jar
2.
3.

What is the expected output? What do you see instead?
preparation of vcard file

What version of the product are you using? On what operating system?
vcard 1.4, windows

Please provide any additional information below.
code:                   getContentResolver().applyBatch(ContactsContract.AUTHORITY,
                            ops);
                    Toast.makeText(getBaseContext(),
                            "Contact is successfully added", Toast.LENGTH_SHORT)
                            .show();
                    OutputStreamWriter writer = new OutputStreamWriter(
                            new FileOutputStream(getFilesDir() + File.separator + "contacts.vcard"), "UTF-8");

                    VCardComposer composer = new VCardComposer();

                    //create a contact
                    ContactStruct contact1 = new ContactStruct();
/*                  contact1.name = "Neo";
                    contact1.company = "The Company";
                    contact1.addPhone(Contacts.Phones.TYPE_MOBILE, "+123456789", null, true);

                    //create vCard representation
                    String vcardString = composer.createVCard(contact1, VCardComposer.VERSION_VCARD30_INT);

                    //write vCard to the output stream
                    writer.write(vcardString);
                    writer.write("\n"); //add empty lines between contacts

                    // repeat for other contacts
                    // ...

                    writer.close();*/
                } catch (RemoteException e) {
                    e.printStackTrace();
                } catch (OperationApplicationException e) {
                    e.printStackTrace();
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();/*
                } catch (VCardException e) {
                    e.printStackTrace();*/
                }
            }

Original issue reported on code.google.com by balaji.p...@gmail.com on 13 Dec 2012 at 9:13

Attachments: