比如有一个网站,数据库是mysqlhttp://www.xxx.com我现在要获取
http://www.xxx.com/test.php?id=2  这个网址的信息这个网址里有5条评论信息姓名  评论的话我要把它们取出来,在经过适当的修改排列,成如图所示的样子,,给个代码吧区域1 为一个按钮,,点击获取http://www.xxx.com/test.php?id=2  这个网址的信息区域2  排版  列出这5条记录,红色区域,左侧箭头显示姓名,右侧箭头显示评论设mysql  表为  info   2个字段name   content
姓名    评论

解决方案 »

  1.   

    或者给个项目例子吧 发送邮件到 [email protected]
      

  2.   

    靠,问题是不是太难了,换个角度吧比如我有一个  webservice这个webservice是有参数的,,也就是说  要调用这个webservice,要给他传参数他才能返回由这个参数查询所得的结果比如这个webservice地址是  http://www.xxx.com/web.asmxPublic String data(String dat)
    {
      ........
      return sdata;
    }那么我要点击一个按钮,使得传进参数为1,请问怎么写代码
      

  3.   

    晕倒,按照书上的例子 也得不到数据,,谁帮我看看,问题在哪Java code    package org.stu; import java.io.IOException; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import org.xmlpull.v1.XmlPullParserException; import android.app.Activity; import android.os.Bundle; import android.widget.EditText; public class StuActivity extends Activity { final static String SERVICE_NS = "http://tempuri.org/"; final static String SERVICE_URL = "http://www.stu80.com/android/list.asmx?wsdl"; private EditText txt1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txt1 = (EditText) findViewById(R.id.txt1); // 调用的方法 String methodName = "HelloWorld"; // 创建HttpTransportSE传输对象 HttpTransportSE ht = new HttpTransportSE(SERVICE_URL); ht.debug = true; // 使用SOAP1.1协议创建Envelop对象 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11 ); // 实例化SoapObject对象 SoapObject soapObject = new SoapObject(SERVICE_NS, methodName); soapObject.addProperty("param", "1"); // 将soapObject对象设置为 SoapSerializationEnvelope对象的传出SOAP消息 envelope.bodyOut = soapObject; try { // 调用Web Service ht.call(null, envelope); if (envelope.getResponse() != null) { // 获取服务器响应返回的SOAP消息 SoapObject result = (SoapObject) envelope.bodyIn; // 接下来就是从SoapObject对象中解析响应数据的过程了。 SoapObject detail1 = (SoapObject) result.getProperty(0); //SoapObject detail2 = (SoapObject) result.getProperty(1); StringBuilder person1 = new StringBuilder(); //person1.append("用户名:"); person1.append(detail1.getProperty(3)); //person1.append("\n密码"); person1.append(detail1.getProperty(0)); //person1.append("\n身高:"); person1.append(detail1.getProperty(1)); txt1.setText(person1.toString()); } } catch (IOException e) { e.printStackTrace(); } catch (XmlPullParserException e) { e.printStackTrace(); } } }
      

  4.   

    发个http请求吧 拿到页面html 然后用jsoup(或者正则)处理一下网页吧 
      

  5.   

    据说android 访问不能用网址   一定要用ip地址比如 111.111.111.111/test.asmx但是我发布到虚拟主机,ip地址不是固定的啊,怎么办啊
      

  6.   

    ip地址不是固定的,每次是用的时候都得到客户端代码改一改,或者你可以改为每次进入都得设置一下ip,之后就用你设置好的那个
      

  7.   

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    namespace test
    {
        /// <summary>
        /// Service1 的摘要说明
        /// </summary>
        [WebService(Namespace = "http://tempuri.org/")]
        [SoapRpcService]
        [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
        [System.ComponentModel.ToolboxItem(false)]
        // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
        // [System.Web.Script.Services.ScriptService]
        public class hello : System.Web.Services.WebService
        {        [SoapRpcMethod, WebMethod]
            public string HelloWorld()
            {
                return "Hello World";
            }
        }
    }package org.stu;import java.io.IOException;import org.ksoap2.SoapEnvelope;
    import org.ksoap2.serialization.SoapObject;
    import org.ksoap2.serialization.SoapSerializationEnvelope;
    import org.ksoap2.transport.HttpTransportSE;
    import org.xmlpull.v1.XmlPullParserException;import android.app.Activity;
    import android.os.Bundle;
    import android.widget.EditText;
    public class StuActivity extends Activity
    {
     String nameSpace = "http://tempuri.org/";
      String methodName = "HelloWorld";
      String url = "http://www.stu80.com/hello.asmx";
    private EditText txt1;
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    txt1 = (EditText) findViewById(R.id.txt1);
    // 调用的方法
    String methodName = "HelloWorld";
    // 创建HttpTransportSE传输对象
    HttpTransportSE ht = new HttpTransportSE(url);
    ht.debug = true;
    // 使用SOAP1.1协议创建Envelop对象
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
    SoapEnvelope.VER11 );
    // 实例化SoapObject对象
    SoapObject soapObject = new SoapObject(nameSpace, methodName);
    // soapObject.addProperty("param", "1");
    // 将soapObject对象设置为 SoapSerializationEnvelope对象的传出SOAP消息
    envelope.bodyOut = soapObject;

    try
    {
    // 调用Web Service
    ht.call(null,  envelope);
    if (envelope.getResponse() != null)
    {
    // 获取服务器响应返回的SOAP消息
    SoapObject result = (SoapObject) envelope.bodyIn;
    txt1.setText(result.toString());
    }
    }
    catch (IOException e)
    {
    e.printStackTrace();
    }
    catch (XmlPullParserException e)
    {
    e.printStackTrace();
    }
    }
    }
    运行报错误,,请问怎么做,,这次代码非常清晰了,,错误是虚拟机里 stopped的那个错误,force close
      

  8.   

    大家快来回答,有用的话 150分赠送http://topic.csdn.net/u/20120512/19/9bf5f467-f1ad-495b-9233-b7e051bf197e.html
      

  9.   

    lz我不会这个,你要是会socket,可以帮帮我吧。
    socket编程求帮助:http://topic.csdn.net/u/20120514/01/e822cd39-6820-412c-a203-79cf9167a9f6.html