Android Question Listview displays null values extracted from Json

Discussion in 'Android Questions' started by Rodney.eales, Mar 9, 2015.

  1. Rodney.eales

    Rodney.eales New Member Licensed 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:

    Code:
    {
    "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""1@humbug.com",
    "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": "2@humbug.com",
    "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": "3@humbug.com",
    "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": "4@humbug.com",
    "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": "5@humbug.com",
    "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!
     

    Attached Files:

    Last edited: Mar 9, 2015
  2. DonManfred

    DonManfred Expert Licensed User

    Use Code-Tags when posting code here! It is then MUCH better to read for everyone.
     
    Rodney.eales likes this.
  3. Rodney.eales

    Rodney.eales New Member Licensed User

    Sorry my mistake!
     
    Last edited: Mar 9, 2015
  4. Erel

    Erel Administrator Staff Member Licensed User

    Rodney.eales likes this.
  5. Rodney.eales

    Rodney.eales New Member Licensed User

    Thank you so much Erel, it worked. Such a powerful tool to use.:)
     
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice