Hi
I am currently developing an android application. In one of the modules, I must push the generated data to the App tables. For this, I use the Backendless.Persistence.save method.
The row gets generated in the Data section of Backendless, however the required columns are not generated (Only default columns like objectId, Update Time etc. show in the table). Also the fault.getMessage() throws “Unable to adapt response to <Classname>”.
Following is the code.
- Score Class
public class Score
{
private String objectId;
int score;
String email;
Score(int score, String email)
{
this.score=score;
this.email=email;
}
public String getObjectId() {
return objectId;
}
void setScore(int score)
{
this.score=score;
}
}2. Calling Backendless.Persistence.save() Score newScore=new Score(Integer.parseInt(points.getText().toString()),LauncherActivity.Email);
newScore.setScore(Integer.parseInt(points.getText().toString()));
Backendless.Persistence.of(Score.class).save( newScore, new AsyncCallback<Score>() {
public void handleResponse( Score response )
{
Toast.makeText(getBaseContext(),“Set the score succesfully”, Toast.LENGTH_SHORT).show();
Log.d(“Debug”,“Set the score succesfully”);
}
public void handleFault( BackendlessFault fault )
{
Toast.makeText(getBaseContext(),fault.getMessage()+" + "+fault.getDetail(), Toast.LENGTH_SHORT).show();
Log.d("Debug","No DB update");
}
});