Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue May 21, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 13 Dec 2012 at 9:13

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant