i have this coding for web service ....but didn't initialize resource location R.id.ws_response
how we can set new id tag in R.java ..how can hot code maually
here is my code.
package com.androidi.webservices;
Using java Syntax Highlighting
- import org.apache.commons.httpclient.HttpClient;
- import org.apache.commons.httpclient.methods.GetMethod;
- import android.app.Activity;
- import android.os.Bundle;
- import android.util.Log;
- import android.widget.TextView;
- public class CallingWebServices extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- HttpClient client = new HttpClient();
- GetMethod get = new GetMethod("http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=USD&ToCurrency=MXN");
- try {
- int status = client.executeMethod(get);
- TextView resultado=(TextView)findViewById(R.id.ws_response); // <-- Error here
- String res="";
- if(status!=404)
- res=get.getResponseBodyAsString();
- else
- res=getString(R.string.ws_not_found);
- resultado.setText(res);
- }
- catch (Exception e) {
- Log.e("Error:",e.getMessage());
- }
- finally {
- get.releaseConnection();
- get=null;
- }
- }
- }
Parsed in 0.035 seconds, using GeSHi 1.0.8.4
except that no problem with remaining code.
even i set string.xml and other things
plz suggest how i can..
by
vamsi




