i'm getting the the following error bad json response: org.json.JSONException: Value Invalid of type java.lang.String cannot be converted to JSONObject. can any one tell me how to convert a file to bytes in android and store it in parse cloud...
InputStream inputstream=assetmanager.open("lmh.jpg");
byte[] data=new byte[inputstream.available()];
ParseFile file = new ParseFile("lmh.jpg", data);
file.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
// TODO Auto-generated method stub
if(e!=null)
Toast.makeText(getApplicationContext(), "ERROR: "+e, Toast.LENGTH_LONG).show();
else
Toast.makeText(getApplicationContext(), "sucess", Toast.LENGTH_LONG).show();
}
});
ParseObject fileu = new ParseObject("FileU");
fileu.put("image", file);
fileu.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
// TODO Auto-generated method stub
}
});
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});