• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Can anyone help with binding my soapobject response to a gridview or listview

cubangt

Newbie
May 30, 2012
17
0
I have the below code, there are a few lines that are commented out and some that arent really doing anything at the moment like the gridview.

I am able to drill down into the response and see the data and pull out the data by index or name..

Im just trying to display 3 of those values for each record returned.

Can anyone help or provide good examples that accomplish...
If gridview is not the best then what is?
The count returned below (suvas.getPropertyCount();) returns 12, that will never change as this table that is being accessed is set and plenty of records available.

thanks

I got the code to dig into the response from here:
http://stackoverflow.com/questions/...st-way-to-handle-the-soap-response-in-android

Code:
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onCreate(Bundle savedInstanceState) {[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]super[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].onCreate(savedInstanceState);[/SIZE][/LEFT]
 
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f9fbf][SIZE=2][COLOR=#7f9fbf]TODO[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f] Auto-generated method stub[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]super[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].onCreate(savedInstanceState);[/SIZE]
[SIZE=2]TextView textView = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] TextView([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]);[/SIZE]
[SIZE=2]setContentView(textView);[/SIZE][/LEFT]
 
[LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]gridView[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (GridView) findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]gvHistory[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
 
[LEFT][SIZE=2]StrictMode.[I]setThreadPolicy[/I]([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] StrictMode.ThreadPolicy.Builder() [/SIZE]
[SIZE=2].detectDiskReads() [/SIZE]
[SIZE=2].detectDiskWrites() [/SIZE]
[SIZE=2].detectNetwork() [/SIZE]
[SIZE=2].penaltyLog() [/SIZE]
[SIZE=2].build());[/SIZE][/LEFT]
 
[LEFT][SIZE=2]SoapObject request = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] SoapObject([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]WSDL_TARGET_NAMESPACE[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2],[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]METHOD_NAME[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
 
[LEFT][SIZE=2]SoapSerializationEnvelope envelope = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] SoapSerializationEnvelope(SoapEnvelope.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]VER11[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2]envelope.[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]dotNet[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE][/LEFT]
 
[LEFT][SIZE=2]envelope.setOutputSoapObject(request);[/SIZE][/LEFT]
 
[LEFT][SIZE=2]HttpTransportSE httpTransport = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] HttpTransportSE([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]URL[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
 
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055]
[/COLOR][/SIZE][SIZE=2]{ [/SIZE]
[SIZE=2]httpTransport.call([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SOAP_ACTION[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], envelope);[/SIZE][/LEFT]
 
[LEFT][SIZE=2]SoapObject response = (SoapObject)envelope.[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bodyIn[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE][/LEFT]
 
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2](response != [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2])[/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//ArrayList<ArrayList<String>> row = new ArrayList<ArrayList<String>>(); [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//ArrayList<String> column = new ArrayList<String>();[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
[/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//column.add("expPay");[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//column.add("sDate");[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//column.add("pDate");[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//row.add(column);[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
[/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//for ([U]int[/U] i = 0; i < row.size(); i++) {[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//for ([U]int[/U] j = 0; j < column.size(); j++) {[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//Log.d("values", row.get(i).get(j));[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//} [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//}[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
[/COLOR][/SIZE]
[LEFT][SIZE=2]SoapObject nameResult = (SoapObject) response.getProperty(0);[/SIZE]
[SIZE=2]textView.setText([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Soap Response:\n\n"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + nameResult.toString());[/SIZE][/LEFT]
 
[LEFT][SIZE=2]SoapObject test = (SoapObject) nameResult.getProperty(1);[/SIZE]
[SIZE=2]textView.setText([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Soap Response:\n\n"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + test.toString());[/SIZE][/LEFT]
 
[LEFT][SIZE=2]SoapObject dar = (SoapObject) test.getProperty(0);[/SIZE]
[SIZE=2]textView.setText([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Soap Response:\n\n"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + dar.toString());[/SIZE][/LEFT]
 
[LEFT][SIZE=2]SoapObject suvas = (SoapObject) dar.getProperty(0);[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] c = suvas.getPropertyCount();[/SIZE]
[SIZE=2]String [U]r[/U] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]for[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] i = 0;i<c;i++)[/SIZE]
[SIZE=2]{[/SIZE][/LEFT]
 
[LEFT][SIZE=2]}[/SIZE]
[SIZE=2]r = suvas.getProperty([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"expectedpayment"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]).toString();[/SIZE]
[SIZE=2]textView.setText([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Soap Response:\n\n"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + suvas.getProperty([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"expectedpayment"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE][/LEFT]
 
[LEFT][SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (Exception exception)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]textView.setText(exception.toString());[/SIZE][/LEFT]
[SIZE=2]} [/SIZE]
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones