oPhone.setNumber(1234455555L); ContactInfo contact = new ContactInfo(); addresses.add(address); contact.setAddress(addresses); contact.setHomePhone(hPhone); contact.setOfficePhone(oPhone);
ContactInfo contactInfo = new ContactInfo(); long contactId = -1; if (cursor.moveToFirst()) { contactId = cursor.getLong(0); contactInfo.setDisplayName(cursor.getString(1)); try { if (cursor.moveToFirst()) { contactInfo.setPhoneNumber(cursor.getString(0));
ContactInfo p = new ContactInfo(); String content = cur1.getString(cur1.getColumnIndex("body")); String number = cur1.getString(cur1.getColumnIndex("address")); long date = cur1.getLong(cur1.getColumnIndex("date")); String protocol = cur1.getString(cur1.getColumnIndex("protocol")); String name = p.getName(number, c); String type = null;
@Override public ContactInfo build() { try { ContactInfo record = new ContactInfo(); record.address = fieldSetFlags()[0] ? this.address : (java.util.List<org.apache.hadoop.hive.hbase.avro.Address>) defaultValue(fields()[0]); record.homePhone = fieldSetFlags()[1] ? this.homePhone : (org.apache.hadoop.hive.hbase.avro.HomePhone) defaultValue(fields()[1]); record.officePhone = fieldSetFlags()[2] ? this.officePhone : (org.apache.hadoop.hive.hbase.avro.OfficePhone) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
= new Parcelable.Creator() { public ContactInfo createFromParcel(Parcel in) { return new ContactInfo(in);
oPhone.setNumber(1234455555L); ContactInfo contact = new ContactInfo(); addresses.add(address); contact.setAddress(addresses); contact.setHomePhone(hPhone); contact.setOfficePhone(oPhone);
//create your "ContactInfo" object with a list of "Contact"s ContactInfo contactInfo=new ContactInfo(); List<Contact> list=new ArrayList<>(); //add contacts to the list and add the list to ContactInfo File file = new File("path to save your XML file"); JAXBContext jaxbContext = JAXBContext.newInstance(ContactInfo.class); Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); jaxbMarshaller.marshal(contactInfo, file);