Android Open Source - Todoist-for-Android X M L R P C Common






From Project

Back to project page Todoist-for-Android.

License

The source code is released under:

GNU General Public License

If you think the Android project Todoist-for-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.

Java Source Code

package org.xmlrpc.android;
//from w ww. 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);
    }
  }

}




Java Source Code List

com.android.applications.todoist.Constants.java
com.android.applications.todoist.containers.Project.java
com.android.applications.todoist.containers.Projects.java
com.android.applications.todoist.containers.Query.java
com.android.applications.todoist.containers.SeparatedListAdapter.java
com.android.applications.todoist.containers.SeparatedTaskListAdapter.java
com.android.applications.todoist.containers.SupportCase.java
com.android.applications.todoist.containers.TaskListAdapter.java
com.android.applications.todoist.containers.Task.java
com.android.applications.todoist.containers.Tasks.java
com.android.applications.todoist.containers.User.java
com.android.applications.todoist.handlers.DBHelper.java
com.android.applications.todoist.handlers.TodoistAPIHandler.java
com.android.applications.todoist.handlers.WebRequest.java
com.android.applications.todoist.views.LoginPage.java
com.android.applications.todoist.views.SupportForm.java
com.android.applications.todoist.views.TasksList.java
org.xmlrpc.android.Base64Coder.java
org.xmlrpc.android.IXMLRPCSerializer.java
org.xmlrpc.android.MethodCall.java
org.xmlrpc.android.Tag.java
org.xmlrpc.android.XMLRPCClient.java
org.xmlrpc.android.XMLRPCCommon.java
org.xmlrpc.android.XMLRPCException.java
org.xmlrpc.android.XMLRPCFault.java
org.xmlrpc.android.XMLRPCSerializable.java
org.xmlrpc.android.XMLRPCSerializer.java
org.xmlrpc.android.XMLRPCServer.java