Fetching the JSON

App Id: 6E1677DA-04FF-4D63-80CC-B7DE756AEF66

import com.backendless.Backendless;
import com.backendless.BackendlessUser;
import com.backendless.async.callback.AsyncCallback;
import com.backendless.persistence.*;
import com.backendless.geo.GeoPoint;

import java.util.HashMap;
import java.util.List;
import java.util.Date;

public class PassengerChauffeurConnection
{
    private Boolean isChauffeurReachedAtPassengerLocation;
    private String rideSelected;
    private String ownerId;
    private String estimatedFare;
    private Object chat;
    private String passengerName;
    private Object afterRideDataToPassenger;
    private String chauffeurBadges;
    private Double currentLocationLat;
    private Integer chauffeurTotalReviews;
    private String chauffeurImage;
    private String chauffeurRatings;
    private Double currentLocationLong;
    private String chauffeurPhoneNumber;
    private Boolean isValidPromoCode;
    private String paymentMethod;
    private Double destinationLocationLat;
    private String chauffeurRideColor;
    private Integer promoCodeDiscount;
    private Double destinationLocationLong;
    private Double chauffeurCurrentLocationLat;
    private Integer slipSlopPayAmount;
    private String rideAcceptedByPassenger;
    private String rideAcceptedByChauffeur;
    private String chauffeurRidePlateNo;
    private String chauffeurRideName;
    private String chauffeurName;
    private Integer noOfPassengers;
    private String passengerPhoneNumber;
    private Double chauffeurCurrentLocationLong;
    private Date updated;
    private Date created;
    private Integer token;
    private String objectId;
    public Boolean getIsChauffeurReachedAtPassengerLocation()
    {
        return isChauffeurReachedAtPassengerLocation;
    }

    public void setIsChauffeurReachedAtPassengerLocation( Boolean isChauffeurReachedAtPassengerLocation )
    {
        this.isChauffeurReachedAtPassengerLocation = isChauffeurReachedAtPassengerLocation;
    }

    public String getRideSelected()
    {
        return rideSelected;
    }

    public void setRideSelected( String rideSelected )
    {
        this.rideSelected = rideSelected;
    }

    public String getOwnerId()
    {
        return ownerId;
    }

    public String getEstimatedFare()
    {
        return estimatedFare;
    }

    public void setEstimatedFare( String estimatedFare )
    {
        this.estimatedFare = estimatedFare;
    }

    public Object getChat()
    {
        return chat;
    }

    public void setChat( Object chat )
    {
        this.chat = chat;
    }

    public String getPassengerName()
    {
        return passengerName;
    }

    public void setPassengerName( String passengerName )
    {
        this.passengerName = passengerName;
    }

    public Object getAfterRideDataToPassenger()
    {
        return afterRideDataToPassenger;
    }

    public void setAfterRideDataToPassenger( Object afterRideDataToPassenger )
    {
        this.afterRideDataToPassenger = afterRideDataToPassenger;
    }

    public String getChauffeurBadges()
    {
        return chauffeurBadges;
    }

    public void setChauffeurBadges( String chauffeurBadges )
    {
        this.chauffeurBadges = chauffeurBadges;
    }

    public Double getCurrentLocationLat()
    {
        return currentLocationLat;
    }

    public void setCurrentLocationLat( Double currentLocationLat )
    {
        this.currentLocationLat = currentLocationLat;
    }

    public Integer getChauffeurTotalReviews()
    {
        return chauffeurTotalReviews;
    }

    public void setChauffeurTotalReviews( Integer chauffeurTotalReviews )
    {
        this.chauffeurTotalReviews = chauffeurTotalReviews;
    }

    public String getChauffeurImage()
    {
        return chauffeurImage;
    }

    public void setChauffeurImage( String chauffeurImage )
    {
        this.chauffeurImage = chauffeurImage;
    }

    public String getChauffeurRatings()
    {
        return chauffeurRatings;
    }

    public void setChauffeurRatings( String chauffeurRatings )
    {
        this.chauffeurRatings = chauffeurRatings;
    }

    public Double getCurrentLocationLong()
    {
        return currentLocationLong;
    }

    public void setCurrentLocationLong( Double currentLocationLong )
    {
        this.currentLocationLong = currentLocationLong;
    }

    public String getChauffeurPhoneNumber()
    {
        return chauffeurPhoneNumber;
    }

    public void setChauffeurPhoneNumber( String chauffeurPhoneNumber )
    {
        this.chauffeurPhoneNumber = chauffeurPhoneNumber;
    }

    public Boolean getIsValidPromoCode()
    {
        return isValidPromoCode;
    }

    public void setIsValidPromoCode( Boolean isValidPromoCode )
    {
        this.isValidPromoCode = isValidPromoCode;
    }

    public String getPaymentMethod()
    {
        return paymentMethod;
    }

    public void setPaymentMethod( String paymentMethod )
    {
        this.paymentMethod = paymentMethod;
    }

    public Double getDestinationLocationLat()
    {
        return destinationLocationLat;
    }

    public void setDestinationLocationLat( Double destinationLocationLat )
    {
        this.destinationLocationLat = destinationLocationLat;
    }

    public String getChauffeurRideColor()
    {
        return chauffeurRideColor;
    }

    public void setChauffeurRideColor( String chauffeurRideColor )
    {
        this.chauffeurRideColor = chauffeurRideColor;
    }

    public Integer getPromoCodeDiscount()
    {
        return promoCodeDiscount;
    }

    public void setPromoCodeDiscount( Integer promoCodeDiscount )
    {
        this.promoCodeDiscount = promoCodeDiscount;
    }

    public Double getDestinationLocationLong()
    {
        return destinationLocationLong;
    }

    public void setDestinationLocationLong( Double destinationLocationLong )
    {
        this.destinationLocationLong = destinationLocationLong;
    }

    public Double getChauffeurCurrentLocationLat()
    {
        return chauffeurCurrentLocationLat;
    }

    public void setChauffeurCurrentLocationLat( Double chauffeurCurrentLocationLat )
    {
        this.chauffeurCurrentLocationLat = chauffeurCurrentLocationLat;
    }

    public Integer getSlipSlopPayAmount()
    {
        return slipSlopPayAmount;
    }

    public void setSlipSlopPayAmount( Integer slipSlopPayAmount )
    {
        this.slipSlopPayAmount = slipSlopPayAmount;
    }

    public String getRideAcceptedByPassenger()
    {
        return rideAcceptedByPassenger;
    }

    public void setRideAcceptedByPassenger( String rideAcceptedByPassenger )
    {
        this.rideAcceptedByPassenger = rideAcceptedByPassenger;
    }

    public String getRideAcceptedByChauffeur()
    {
        return rideAcceptedByChauffeur;
    }

    public void setRideAcceptedByChauffeur( String rideAcceptedByChauffeur )
    {
        this.rideAcceptedByChauffeur = rideAcceptedByChauffeur;
    }

    public String getChauffeurRidePlateNo()
    {
        return chauffeurRidePlateNo;
    }

    public void setChauffeurRidePlateNo( String chauffeurRidePlateNo )
    {
        this.chauffeurRidePlateNo = chauffeurRidePlateNo;
    }

    public String getChauffeurRideName()
    {
        return chauffeurRideName;
    }

    public void setChauffeurRideName( String chauffeurRideName )
    {
        this.chauffeurRideName = chauffeurRideName;
    }

    public String getChauffeurName()
    {
        return chauffeurName;
    }

    public void setChauffeurName( String chauffeurName )
    {
        this.chauffeurName = chauffeurName;
    }

    public Integer getNoOfPassengers()
    {
        return noOfPassengers;
    }

    public void setNoOfPassengers( Integer noOfPassengers )
    {
        this.noOfPassengers = noOfPassengers;
    }

    public String getPassengerPhoneNumber()
    {
        return passengerPhoneNumber;
    }

    public void setPassengerPhoneNumber( String passengerPhoneNumber )
    {
        this.passengerPhoneNumber = passengerPhoneNumber;
    }

    public Double getChauffeurCurrentLocationLong()
    {
        return chauffeurCurrentLocationLong;
    }

    public void setChauffeurCurrentLocationLong( Double chauffeurCurrentLocationLong )
    {
        this.chauffeurCurrentLocationLong = chauffeurCurrentLocationLong;
    }

    public Date getUpdated()
    {
        return updated;
    }

    public Date getCreated()
    {
        return created;
    }

    public Integer getToken()
    {
        return token;
    }

    public void setToken( Integer token )
    {
        this.token = token;
    }

    public String getObjectId()
    {
        return objectId;
    }


    public PassengerChauffeurConnection save()
    {
        return Backendless.Data.of( PassengerChauffeurConnection.class ).save( this );
    }

    public void saveAsync( AsyncCallback<PassengerChauffeurConnection> callback )
    {
        Backendless.Data.of( PassengerChauffeurConnection.class ).save( this, callback );
    }

    public Long remove()
    {
        return Backendless.Data.of( PassengerChauffeurConnection.class ).remove( this );
    }

    public void removeAsync( AsyncCallback<Long> callback )
    {
        Backendless.Data.of( PassengerChauffeurConnection.class ).remove( this, callback );
    }

    public static PassengerChauffeurConnection findById( String id )
    {
        return Backendless.Data.of( PassengerChauffeurConnection.class ).findById( id );
    }

    public static void findByIdAsync( String id, AsyncCallback<PassengerChauffeurConnection> callback )
    {
        Backendless.Data.of( PassengerChauffeurConnection.class ).findById( id, callback );
    }

    public static PassengerChauffeurConnection findFirst()
    {
        return Backendless.Data.of( PassengerChauffeurConnection.class ).findFirst();
    }

    public static void findFirstAsync( AsyncCallback<PassengerChauffeurConnection> callback )
    {
        Backendless.Data.of( PassengerChauffeurConnection.class ).findFirst( callback );
    }

    public static PassengerChauffeurConnection findLast()
    {
        return Backendless.Data.of( PassengerChauffeurConnection.class ).findLast();
    }

    public static void findLastAsync( AsyncCallback<PassengerChauffeurConnection> callback )
    {
        Backendless.Data.of( PassengerChauffeurConnection.class ).findLast( callback );
    }

    public static List<PassengerChauffeurConnection> find( DataQueryBuilder queryBuilder )
    {
        return Backendless.Data.of( PassengerChauffeurConnection.class ).find( queryBuilder );
    }

    public static void findAsync( DataQueryBuilder queryBuilder, AsyncCallback<List<PassengerChauffeurConnection>> callback )
    {
        Backendless.Data.of( PassengerChauffeurConnection.class ).find( queryBuilder, callback );
    }
}

If you change the fields and get/set methods for afterRideDataToPassenger and chat to HashMap, then it will work. JSON columns must be represented as HashMap.

This solves the issue for crashing but i am still getting my JSON as rawJSON

{rawJsonString={"SaadZahoor": "gjck0: (1599761650127)"},
___class=com.backendless.persistence.JsonDTO}

the value in the console for chat column is as

{
  "SaadZahoor": "gjck0: (1599761650127)"
}

this is the code for fetching the property “chat”

        HashMap getJSON = response.get(0).getChat();
        Log.i("kkkk" ,String.valueOf(getJSON));

        Toast.makeText(this, "Object: " + getJSON, Toast.LENGTH_SHORT).show();

It appears to be a regression in the SDK. I raised an internal ticket. We will try to fix it as fast as possible.

Regards,
Mark

The ticket number is BKNDLSS-22707

Any update regarding the JSON Fetching issue?

Hi Saad,

The problem has been fixed. Make sure to update the Backendless dependency to version 6.1.0

Regards,
Mark