Hi,
There is a way to create tables dynamically programmatically?
Assume each time that user register, new table will be created with his name.
is this possible?
thanks
Hi Xcode,
Although I would discourage you from creating a table per user, it is entirely possible. Here’s an example which creates table with the name of “JohnDoe” (you can put any value here representing the user):
HashMap<String, Object> dataObject = new HashMap<String, Object>();
dataObject.put( “anyProperty”, “anyValue” );
Backendless.Data.of( “JohnDoe” ).save( dataObject, new AsyncCallback<Map>()
{
@Override
public void handleResponse( Map response )
{
Log.i( “MYAPP”, “object saved” );
}
@Override
public void handleFault( BackendlessFault fault )
{
Log.e( “MYAPP”, "error - " + fault.getMessage() );
}
} );