Create & Save Object
Storing data on Symbyoz is built around Parse and his ParseObject
.
Each ParseObject
contains key-value pairs of JSON-compatible data. This data is schemaless, which means that you don’t need to specify ahead of time what keys exist on each ParseObject
.
If you want to have a structured model of your object, you can do it so by registering what we call Subclasses (see more infos on this page).
Simple Way
import com.parse.ParseObject;
public void createObject()
{
ParseObject object = new ParseObject("ClassName");
// object.put(key, value);
object.put("age", 37);
object.put("userName", "John Doe");
object.put("isFunny", false);
object.saveInBackground();
}
With Callback
import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.SaveCallback;
public void createObject()
{
ParseObject object = new ParseObject("ClassName");
// object.put(key, value);
object.put("age", 37);
object.put("userName", "John Doe");
object.put("isFunny", false);
object.saveInBackground(new SaveCallback()
{
@Override
public void done(ParseException e)
{
}
});
}
Last updated
Was this helpful?