我在我的android应用程序中有一个TextView。现在我需要从ashx页面获得一个值。当我在浏览器中打开该ashx页面时,我可以看到它只显示一个值。我需要在我的TextView中显示这个值。如何从ashx页面获取android中的字符串值?
请帮我...
我在我的android应用程序中有一个TextView。现在我需要从ashx页面获得一个值。当我在浏览器中打开该ashx页面时,我可以看到它只显示一个值。我需要在我的TextView中显示这个值。如何从ashx页面获取android中的字符串值?
请帮我...
获取Internet权限....和公正运行这段代码...
try
{
HttpClient client=new DefaultHttpClient();
HttpGet request=new HttpGet("http://173.45.66.154/VSServices/Export.ashx?f=GetClientBalance&pin=rsbtest&includeCurrency=true");
HttpResponse response=client.execute(request);
HttpEntity entity=response.getEntity();
String resonseText=EntityUtils.toString(entity);
textviewObject.setText(resonseText);
entity.consumeContent();
}
catch(Exception e)
{
e.getStackTrace();
Toast.makeText(MainActivity.this, e.toString() , 0).show();
}
你能告诉我ashx的网页...与网址.. ..? – 2014-10-20 07:03:53
http://173.45.66.154/VSServices/Export.ashx?f=GetClientBalance&pin=rsbtest&includeCurrency=true – Shoaib 2014-10-20 07:04:16
@AngadTiwari:这是 – Shoaib 2014-10-20 07:05:33