Android Question Listview displays null values extracted from Json

Rodney.eales

New Member
Licensed User
Longtime User
Hi all, I am new to basic4android, can you assist me please, I am extracting name, cellphone, balance from a dummy webservice and displaying it in a listview, but it returns null values. I have been looking at the tutorials for using a listview when exctracting information from a json but the structures are different, as the one that I am extracting from starts with an object which contains another object and the second object has another object that holds an array. I have commented out some of the lines as since they gave me some errors.

json:

B4X:
{
"Success": true,
"Result": [
{
"Name": "Name: 1",
"Street1": null,
"Street2": null,
"City": null,
"Province": null,
"Postal": null,
"Phone": null,
"CellPhone": "Cell Phone Number: 1",
"Fax": null,
"Email": "[email protected]",
"VAT": null,
"CK": null,
"BallanceDue": 10000,
"YearToDatePurchase": 0,
"OpenOrders": 0,
"DelMethod": 0,
"CreditControl": false,
"CreditLimit": 1.01,
"CreditHold": false,
"IsInActive": false,
"Updated": "0001-01-01T00:00:00",
"Contact": null,
"Field1": null,
"Field2": null,
"Field3": null,
"Field4": null,
"Field5": null,
"Field6": null,
"Field7": null,
"Field8": null,
"Field9": null,
"Field10": null,
"Field11": null,
"Field12": null,
"Since": "0001-01-01T00:00:00",
"Notes": null,
"ID": "00000000-0000-0000-0000-000000000000",
"InterestRate": 0,
"CustomerDescription": null,
"CountryName": null,
"BallanceDueF": 0,
"YearToDatePurchaseF": 0,
"OpenOrdersF": 0,
"EmailInvoice": null,
"EmailStatement": null,
"TradeDiscountPercentage": 0,
"CreditLimitOverride": 0,
"CreditLimitExpiryDate": "0001-01-01T00:00:00",
"PartialBackorders": 0,
"WithholdTax": false,
"WithholdTaxCode": null,
"InventoryFormDocumentName": null,
"OrderFormDocumentName": null,
"IsMatrixType": false,
"ParentCust": null,
"InvoiceWorkflowNew": false,
"InvoiceWorkflowDA": false,
"InvoiceWorkflowSO": false,
"Website": null,
"RSTTerminalSync": null,
"Contact2": null,
"Suburb": null,
"PriceListName": null,
"TaxCodeName": null,
"CurrencyCode": null,
"CustomerCategoryName": null,
"DepartmentID": 0,
"CountryCode": null,
"TenderTypeName": null,
"TermName": null,
"TradeDiscountMaxtrixName": null,
"ValueBasedName": null,
"Country": null,
"Currency": null,
"CustomerCategory": null,
"Department": null,
"PriceList": null,
"TaxCode": null,
"TenderType": null,
"Term": null,
"TradeDiscountMatrix": null,
"ValueBased": null,
"CustomerSalesPersonDetails": [],
"CustomerLocations": [],
"OrderDocuments": []
},
{
"Name": "Name: 2",
"Street1": null,
"Street2": null,
"City": null,
"Province": null,
"Postal": null,
"Phone": null,
"CellPhone": "Cell Phone Number: 2",
"Fax": null,
"Email": "[email protected]",
"VAT": null,
"CK": null,
"BallanceDue": 20000,
"YearToDatePurchase": 0,
"OpenOrders": 0,
"DelMethod": 0,
"CreditControl": false,
"CreditLimit": 2.01,
"CreditHold": false,
"IsInActive": false,
"Updated": "0001-01-01T00:00:00",
"Contact": null,
"Field1": null,
"Field2": null,
"Field3": null,
"Field4": null,
"Field5": null,
"Field6": null,
"Field7": null,
"Field8": null,
"Field9": null,
"Field10": null,
"Field11": null,
"Field12": null,
"Since": "0001-01-01T00:00:00",
"Notes": null,
"ID": "00000000-0000-0000-0000-000000000000",
"InterestRate": 0,
"CustomerDescription": null,
"CountryName": null,
"BallanceDueF": 0,
"YearToDatePurchaseF": 0,
"OpenOrdersF": 0,
"EmailInvoice": null,
"EmailStatement": null,
"TradeDiscountPercentage": 0,
"CreditLimitOverride": 0,
"CreditLimitExpiryDate": "0001-01-01T00:00:00",
"PartialBackorders": 0,
"WithholdTax": false,
"WithholdTaxCode": null,
"InventoryFormDocumentName": null,
"OrderFormDocumentName": null,
"IsMatrixType": false,
"ParentCust": null,
"InvoiceWorkflowNew": false,
"InvoiceWorkflowDA": false,
"InvoiceWorkflowSO": false,
"Website": null,
"RSTTerminalSync": null,
"Contact2": null,
"Suburb": null,
"PriceListName": null,
"TaxCodeName": null,
"CurrencyCode": null,
"CustomerCategoryName": null,
"DepartmentID": 0,
"CountryCode": null,
"TenderTypeName": null,
"TermName": null,
"TradeDiscountMaxtrixName": null,
"ValueBasedName": null,
"Country": null,
"Currency": null,
"CustomerCategory": null,
"Department": null,
"PriceList": null,
"TaxCode": null,
"TenderType": null,
"Term": null,
"TradeDiscountMatrix": null,
"ValueBased": null,
"CustomerSalesPersonDetails": [],
"CustomerLocations": [],
"OrderDocuments": []
},
{
"Name": "Name: 3",
"Street1": null,
"Street2": null,
"City": null,
"Province": null,
"Postal": null,
"Phone": null,
"CellPhone": "Cell Phone Number: 3",
"Fax": null,
"Email": "[email protected]",
"VAT": null,
"CK": null,
"BallanceDue": 30000,
"YearToDatePurchase": 0,
"OpenOrders": 0,
"DelMethod": 0,
"CreditControl": false,
"CreditLimit": 3.01,
"CreditHold": false,
"IsInActive": false,
"Updated": "0001-01-01T00:00:00",
"Contact": null,
"Field1": null,
"Field2": null,
"Field3": null,
"Field4": null,
"Field5": null,
"Field6": null,
"Field7": null,
"Field8": null,
"Field9": null,
"Field10": null,
"Field11": null,
"Field12": null,
"Since": "0001-01-01T00:00:00",
"Notes": null,
"ID": "00000000-0000-0000-0000-000000000000",
"InterestRate": 0,
"CustomerDescription": null,
"CountryName": null,
"BallanceDueF": 0,
"YearToDatePurchaseF": 0,
"OpenOrdersF": 0,
"EmailInvoice": null,
"EmailStatement": null,
"TradeDiscountPercentage": 0,
"CreditLimitOverride": 0,
"CreditLimitExpiryDate": "0001-01-01T00:00:00",
"PartialBackorders": 0,
"WithholdTax": false,
"WithholdTaxCode": null,
"InventoryFormDocumentName": null,
"OrderFormDocumentName": null,
"IsMatrixType": false,
"ParentCust": null,
"InvoiceWorkflowNew": false,
"InvoiceWorkflowDA": false,
"InvoiceWorkflowSO": false,
"Website": null,
"RSTTerminalSync": null,
"Contact2": null,
"Suburb": null,
"PriceListName": null,
"TaxCodeName": null,
"CurrencyCode": null,
"CustomerCategoryName": null,
"DepartmentID": 0,
"CountryCode": null,
"TenderTypeName": null,
"TermName": null,
"TradeDiscountMaxtrixName": null,
"ValueBasedName": null,
"Country": null,
"Currency": null,
"CustomerCategory": null,
"Department": null,
"PriceList": null,
"TaxCode": null,
"TenderType": null,
"Term": null,
"TradeDiscountMatrix": null,
"ValueBased": null,
"CustomerSalesPersonDetails": [],
"CustomerLocations": [],
"OrderDocuments": []
},
{
"Name": "Name: 4",
"Street1": null,
"Street2": null,
"City": null,
"Province": null,
"Postal": null,
"Phone": null,
"CellPhone": "Cell Phone Number: 4",
"Fax": null,
"Email": "[email protected]",
"VAT": null,
"CK": null,
"BallanceDue": 40000,
"YearToDatePurchase": 0,
"OpenOrders": 0,
"DelMethod": 0,
"CreditControl": false,
"CreditLimit": 4.01,
"CreditHold": false,
"IsInActive": false,
"Updated": "0001-01-01T00:00:00",
"Contact": null,
"Field1": null,
"Field2": null,
"Field3": null,
"Field4": null,
"Field5": null,
"Field6": null,
"Field7": null,
"Field8": null,
"Field9": null,
"Field10": null,
"Field11": null,
"Field12": null,
"Since": "0001-01-01T00:00:00",
"Notes": null,
"ID": "00000000-0000-0000-0000-000000000000",
"InterestRate": 0,
"CustomerDescription": null,
"CountryName": null,
"BallanceDueF": 0,
"YearToDatePurchaseF": 0,
"OpenOrdersF": 0,
"EmailInvoice": null,
"EmailStatement": null,
"TradeDiscountPercentage": 0,
"CreditLimitOverride": 0,
"CreditLimitExpiryDate": "0001-01-01T00:00:00",
"PartialBackorders": 0,
"WithholdTax": false,
"WithholdTaxCode": null,
"InventoryFormDocumentName": null,
"OrderFormDocumentName": null,
"IsMatrixType": false,
"ParentCust": null,
"InvoiceWorkflowNew": false,
"InvoiceWorkflowDA": false,
"InvoiceWorkflowSO": false,
"Website": null,
"RSTTerminalSync": null,
"Contact2": null,
"Suburb": null,
"PriceListName": null,
"TaxCodeName": null,
"CurrencyCode": null,
"CustomerCategoryName": null,
"DepartmentID": 0,
"CountryCode": null,
"TenderTypeName": null,
"TermName": null,
"TradeDiscountMaxtrixName": null,
"ValueBasedName": null,
"Country": null,
"Currency": null,
"CustomerCategory": null,
"Department": null,
"PriceList": null,
"TaxCode": null,
"TenderType": null,
"Term": null,
"TradeDiscountMatrix": null,
"ValueBased": null,
"CustomerSalesPersonDetails": [],
"CustomerLocations": [],
"OrderDocuments": []
},
{
"Name": "Name: 5",
"Street1": null,
"Street2": null,
"City": null,
"Province": null,
"Postal": null,
"Phone": null,
"CellPhone": "Cell Phone Number: 5",
"Fax": null,
"Email": "[email protected]",
"VAT": null,
"CK": null,
"BallanceDue": 50000,
"YearToDatePurchase": 0,
"OpenOrders": 0,
"DelMethod": 0,
"CreditControl": false,
"CreditLimit": 5.01,
"CreditHold": false,
"IsInActive": false,
"Updated": "0001-01-01T00:00:00",
"Contact": null,
"Field1": null,
"Field2": null,
"Field3": null,
"Field4": null,
"Field5": null,
"Field6": null,
"Field7": null,
"Field8": null,
"Field9": null,
"Field10": null,
"Field11": null,
"Field12": null,
"Since": "0001-01-01T00:00:00",
"Notes": null,
"ID": "00000000-0000-0000-0000-000000000000",
"InterestRate": 0,
"CustomerDescription": null,
"CountryName": null,
"BallanceDueF": 0,
"YearToDatePurchaseF": 0,
"OpenOrdersF": 0,
"EmailInvoice": null,
"EmailStatement": null,
"TradeDiscountPercentage": 0,
"CreditLimitOverride": 0,
"CreditLimitExpiryDate": "0001-01-01T00:00:00",
"PartialBackorders": 0,
"WithholdTax": false,
"WithholdTaxCode": null,
"InventoryFormDocumentName": null,
"OrderFormDocumentName": null,
"IsMatrixType": false,
"ParentCust": null,
"InvoiceWorkflowNew": false,
"InvoiceWorkflowDA": false,
"InvoiceWorkflowSO": false,
"Website": null,
"RSTTerminalSync": null,
"Contact2": null,
"Suburb": null,
"PriceListName": null,
"TaxCodeName": null,
"CurrencyCode": null,
"CustomerCategoryName": null,
"DepartmentID": 0,
"CountryCode": null,
"TenderTypeName": null,
"TermName": null,
"TradeDiscountMaxtrixName": null,
"ValueBasedName": null,
"Country": null,
"Currency": null,
"CustomerCategory": null,
"Department": null,
"PriceList": null,
"TaxCode": null,
"TenderType": null,
"Term": null,
"TradeDiscountMatrix": null,
"ValueBased": null,
"CustomerSalesPersonDetails": [],
"CustomerLocations": [],
"OrderDocuments": []
}
],
"Error": null
}

I have also attached my code, thank you!
 

Attachments

  • WebServices.zip
    60.7 KB · Views: 195
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Use Code-Tags when posting code here! It is then MUCH better to read for everyone.
 
Upvote 0
Top