class java android layout

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

class java android layout

Postby miscialo » Sun Jan 17, 2010 3:09 pm

hi i want to transform this java class for android...
could you help me?

Code: Select all
import java.util.*;
import helma.xmlrpc.*;

public class JavaClient {

    // The location of our server.
    private final static String server_url = "http://127.0.0.1/test/xmlrpc.php";

    public static void main (String [] args) {
        try {

            // Create an object to represent our server.

            XmlRpcClient server = new XmlRpcClient(server_url);

            // Build our parameter list.
            Vector params = new Vector();
            params.addElement(new Integer(45));
            params.addElement(new Integer(70));

            // Call the server, and get our result.

            Hashtable result = (Hashtable) server.execute("operation", params);
            int sum = ((Integer) result.get("sum")).intValue();
           
            // Print out our result.
            System.out.println("sum: " + Integer.toString(sum));

        } catch (XmlRpcException exception) {
            System.err.println("JavaClient: XML-RPC Fault #" + Integer.toString(exception.code) + ": " + exception.toString());
        } catch (Exception exception) {
            System.err.println("JavaClient: " + exception.toString());
        }
    }
}
Last edited by miscialo on Sun Jan 17, 2010 3:58 pm, edited 1 time in total.
miscialo
Freshman
Freshman
 
Posts: 8
Joined: Thu Jan 14, 2010 12:26 am

Top

Postby sing1e » Sun Jan 17, 2010 3:54 pm

Hi,

I think you can use HttpClient.
sing1e
Freshman
Freshman
 
Posts: 9
Joined: Sat Dec 12, 2009 10:55 am

Postby miscialo » Sun Jan 17, 2010 3:56 pm

what do you mean?
miscialo
Freshman
Freshman
 
Posts: 8
Joined: Thu Jan 14, 2010 12:26 am

Re: class java android layout

Postby pskink » Sun Jan 17, 2010 7:33 pm

miscialo wrote:hi i want to transform this java class for android...
could you help me?

Code: Select all
import java.util.*;
import helma.xmlrpc.*;

public class JavaClient {

    // The location of our server.
    private final static String server_url = "http://127.0.0.1/test/xmlrpc.php";

    public static void main (String [] args) {
        try {

            // Create an object to represent our server.

            XmlRpcClient server = new XmlRpcClient(server_url);

            // Build our parameter list.
            Vector params = new Vector();
            params.addElement(new Integer(45));
            params.addElement(new Integer(70));

            // Call the server, and get our result.

            Hashtable result = (Hashtable) server.execute("operation", params);
            int sum = ((Integer) result.get("sum")).intValue();
           
            // Print out our result.
            System.out.println("sum: " + Integer.toString(sum));

        } catch (XmlRpcException exception) {
            System.err.println("JavaClient: XML-RPC Fault #" + Integer.toString(exception.code) + ": " + exception.toString());
        } catch (Exception exception) {
            System.err.println("JavaClient: " + exception.toString());
        }
    }
}



what about this one:
http://code.google.com/p/android-xmlrpc/

pskink
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests