The example in this article describes how Android uses a vcard file. Share to everyone for your reference, specific as follows:
FileOutputStream OS = null; try {os = VCardTest.this.openFileOutput ("android.vcf", mode_private);} catch (FileNotFoundException E1) {//TODO Au
To-generated Catch block E1.printstacktrace ();
} OutputStreamWriter writer;
try {writer = new outputstreamwriter (OS);
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;
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 (Unsupportedencodingexception e) {//TODO auto-generated catch block E.printstacktrace ();} catch (Filenotfou Ndexception e) {//TODO auto-Generated catch block E.printstacktrace (); catch (Vcardexception e) {//TODO auto-generated catch block e.printstacktrace (); \ catch (IOException e) {/To
Do auto-generated catch block E.printstacktrace ();
}
For more information on Android-related content readers can view the site: "Android file Operation tips Summary", "Android Database Operating skills summary", "Android programming activity Operation Skills Summary", " Android programming development of the SD card operation method Summary, "Android Development introduction and Advanced Course", "Android Resource Operation skills Summary", "Android View tips Summary" and "Android Control usage Summary"
I hope this article will help you with the Android program.