Saving Data Objects to Backendless in Android

Hi,

I’m having some to save objects to Backendless. I’m trying the same method as proposed in the documentation. Here is my code:

Backendless.Persistence.save(desire, new AsyncCallback<Desire>() {
public void handleResponse( Desire response ){

 }
 public void handleFault( BackendlessFault fault ){
 // an error has occurred, the error code can be retrieved with fault.getCode()
 }

});

But each time this code is executed, the handleFault method is called. The faultCode is IllegalArgumentException, detail is null and message is: “weborb/util/ObjectInspector”. My Desire class has the following attributes:

private String objectId;
private int name;
private int unit;
private int state;
private double quantity;

All attributes have public getters and setters.
The backendless database has a table named Desire with the following columns:

unit | data type: int
state | data type: int
name | data type: int
quantity | data type: double

Searching and deleting Desire objects works fine, but I can’t get save working. Does anyone have any idea what I am doing wrong? Thanks on advance.

With kind regards.

I am having the same problem

Hi Joel,

Do you have by any chance Proguard enabled on the Android device?

If not, could you email me your app id, android secret key and the Desire class source code? My email address is mark@backendless.com

Regards,
Mark

Im not sure. How do I check if Proguard is enabled?

and how can I turn it off if it is on?

this conversation was taken offline… For the benefit others who have similar problem, the clue was in the BackendlessFault object delivered to the fault handler. The root cause of the problem was “sending data to the database that did not match the pattern of the field in the table.”

hey mark ,

am having the same problem as above mentioned what should i do for fixing it ?

What message do you get in the fault object?

hey mark, i have a similar problem

Kartik, this topic is already marked as “Answered”. Please open a new one.