Back to project page openhds-tablet.
The source code is released under:
OPENHDS PLATFORM OPENSOURCE LICENSE AGREEMENT Copyright (c) 2013 University of Southern Maine. All rights reserved. Redistribution and use in source and binary forms, with or without mo...
If you think the Android project openhds-tablet listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.openhds.mobile.database; /*from w w w . j a v a 2 s. co m*/ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import org.openhds.mobile.OpenHDS; import org.openhds.mobile.model.FormXmlReader; import org.openhds.mobile.model.Membership; import android.content.ContentResolver; import android.content.ContentValues; import android.util.Log; public class MembershipUpdate implements Updatable { public void updateDatabase(ContentResolver resolver, String filepath,String jrFormId) { FormXmlReader xmlReader = new FormXmlReader(); try { Membership membership = xmlReader.readMembership(new FileInputStream(new File(filepath)), jrFormId); if (membership == null) { return; } ContentValues cv = new ContentValues(); cv.put(OpenHDS.IndividualGroups.COLUMN_INDIVIDUALUUID, membership.getIndExtId()); cv.put(OpenHDS.IndividualGroups.COLUMN_SOCIALGROUPUUID, membership.getGroupextId()); resolver.insert(OpenHDS.IndividualGroups.CONTENT_ID_URI_BASE, cv); } catch (FileNotFoundException e) { Log.e(VisitUpdate.class.getName(), "Could not read Membership XML file"); } } }