Code example for XmlSerializer

Methods: endTagsetOutputstartTagtext

0
    } 
     
    private void initXML() throws IllegalArgumentException, IllegalStateException, IOException { 
    	fos = a.getApplicationContext().openFileOutput(FILENAME,Context.MODE_APPEND);
    	xmlSerializer = Xml.newSerializer();
    	xmlSerializer.setOutput(fos, "UTF-8");
    	 
    	//day tag encloses today's entry 
    	xmlSerializer.startTag(ns, TAG_DAY);
		 
    	//one entry, for date 
    	xmlSerializer.startTag(ns, TAG_DATE);
		xmlSerializer.text(xmlDate);
		xmlSerializer.endTag(ns, TAG_DATE);
    } 
    private void writeXMLContent(String activityName, String timeSpent, long isProductive) throws IllegalArgumentException, IllegalStateException, IOException{
    	//oh lord do forgive my indentation 
    	xmlSerializer.startTag(ns, TAG_ACTIVITY);
	    	xmlSerializer.startTag(ns, TAG_NAME);
				xmlSerializer.text(activityName);
Connect your IDE to all the code out there  Get Codota for Java