Back to project page One-Button-App---Android.
The source code is released under:
Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (...
If you think the Android project One-Button-App---Android 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.xmlrpc.android; // ww w.j a v a 2s . co m import java.io.IOException; import org.xmlpull.v1.XmlSerializer; import android.util.Xml; class XMLRPCCommon { protected XmlSerializer serializer; protected IXMLRPCSerializer iXMLRPCSerializer; XMLRPCCommon() { serializer = Xml.newSerializer(); iXMLRPCSerializer = new XMLRPCSerializer(); } /** * Sets custom IXMLRPCSerializer serializer (in case when server doesn't support * standard XMLRPC protocol) * * @param serializer custom serializer */ public void setSerializer(IXMLRPCSerializer serializer) { iXMLRPCSerializer = serializer; } protected void serializeParams(Object[] params) throws IllegalArgumentException, IllegalStateException, IOException { if (params != null && params.length != 0) { // set method params serializer.startTag(null, Tag.PARAMS); for (int i=0; i<params.length; i++) { serializer.startTag(null, Tag.PARAM).startTag(null, IXMLRPCSerializer.TAG_VALUE); iXMLRPCSerializer.serialize(serializer, params[i]); serializer.endTag(null, IXMLRPCSerializer.TAG_VALUE).endTag(null, Tag.PARAM); } serializer.endTag(null, Tag.PARAMS); } } }