use of com.backendless.exceptions.BackendlessFault in project Android-SDK by Backendless.
the class MapDrivenDataStore method findLast.
@Override
public void findLast(AsyncCallback<Map> responder) {
try {
Object[] args = new Object[] { tableName };
Invoker.invokeAsync(Persistence.PERSISTENCE_MANAGER_SERVER_ALIAS, "last", args, responder);
} catch (Throwable e) {
if (responder != null)
responder.handleFault(new BackendlessFault(e));
}
}
use of com.backendless.exceptions.BackendlessFault in project Android-SDK by Backendless.
the class MapDrivenDataStore method findLast.
private void findLast(List<String> relations, Integer relationsDepth, AsyncCallback<Map> responder) {
try {
Object[] args = new Object[] { tableName, relations, relationsDepth };
Invoker.invokeAsync(Persistence.PERSISTENCE_MANAGER_SERVER_ALIAS, "last", args, responder);
} catch (Throwable e) {
if (responder != null)
responder.handleFault(new BackendlessFault(e));
}
}
use of com.backendless.exceptions.BackendlessFault in project Android-SDK by Backendless.
the class MapDrivenDataStore method getObjectCount.
@Override
public void getObjectCount(AsyncCallback<Integer> responder) {
try {
Object[] args = new Object[] { tableName };
Invoker.invokeAsync(Persistence.PERSISTENCE_MANAGER_SERVER_ALIAS, "count", args, responder);
} catch (Throwable e) {
if (responder != null)
responder.handleFault(new BackendlessFault(e));
}
}
use of com.backendless.exceptions.BackendlessFault in project Android-SDK by Backendless.
the class MapDrivenDataStore method getObjectCount.
@Override
public void getObjectCount(DataQueryBuilder dataQueryBuilder, AsyncCallback<Integer> responder) {
try {
if (dataQueryBuilder == null)
throw new IllegalArgumentException(ExceptionMessage.NULL_FIELD("dataQueryBuilder"));
BackendlessDataQuery dataQuery = dataQueryBuilder.build();
Object[] args = new Object[] { tableName, dataQuery };
Invoker.invokeAsync(Persistence.PERSISTENCE_MANAGER_SERVER_ALIAS, "count", args, responder);
} catch (Throwable e) {
if (responder != null)
responder.handleFault(new BackendlessFault(e));
}
}
use of com.backendless.exceptions.BackendlessFault in project Android-SDK by Backendless.
the class LoginActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_login);
Backendless.initApp(LoginActivity.this, Default.APP_ID, Default.SECRET_KEY, Default.VERSION);
TextView textEmail = (TextView) findViewById(R.id.textEmail);
TextView textPass = (TextView) findViewById(R.id.textPass);
TextView textPiar = (TextView) findViewById(R.id.textPiar);
TextView textOr = (TextView) findViewById(R.id.textOr);
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/verdana.ttf");
textEmail.setTypeface(typeface);
textPass.setTypeface(typeface);
textPiar.setTypeface(typeface);
textOr.setTypeface(typeface);
final Button loginBtn = (Button) findViewById(R.id.loginBtn);
loginBtn.setTypeface(typeface);
loginBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText editEmailText = (EditText) findViewById(R.id.emailEdit);
EditText editPasswordText = (EditText) findViewById(R.id.passwordEdit);
final String messageMail = editEmailText.getText().toString();
final String messagePassword = editPasswordText.getText().toString();
if (TextUtils.isEmpty(messageMail) || TextUtils.isEmpty(messagePassword)) {
String alertMessage = "Please, fill in empty fields!";
Toast.makeText(LoginActivity.this, alertMessage, Toast.LENGTH_LONG).show();
return;
}
progressDialog = ProgressDialog.show(LoginActivity.this, "", "Loading", true);
Backendless.UserService.login(messageMail, messagePassword, new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser backendlessUser) {
progressDialog.cancel();
Intent intent = new Intent(LoginActivity.this, EndlessTaggingActivity.class);
intent.putExtra(Default.EXTRA_EMAIL, messageMail);
intent.putExtra(Default.EXTRA_PASSWORD, messagePassword);
startActivity(intent);
}
@Override
public void handleFault(BackendlessFault backendlessFault) {
progressDialog.cancel();
Toast.makeText(LoginActivity.this, backendlessFault.getMessage(), Toast.LENGTH_LONG).show();
}
});
}
});
Button goRegistrationBtn = (Button) findViewById(R.id.goRegistrationBtn);
goRegistrationBtn.setTypeface(typeface);
goRegistrationBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(LoginActivity.this, RegistrationActivity.class);
startActivity(intent);
finish();
}
});
Button facebookBtn = (Button) findViewById(R.id.facebookBtn);
facebookBtn.setTypeface(typeface);
facebookBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Backendless.UserService.loginWithFacebook(LoginActivity.this, new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
Intent intent = new Intent(LoginActivity.this, EndlessTaggingActivity.class);
startActivity(intent);
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(LoginActivity.this, fault.getMessage(), Toast.LENGTH_LONG).show();
}
});
}
});
Button twitterBtn = (Button) findViewById(R.id.twitterBtn);
twitterBtn.setTypeface(typeface);
twitterBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Backendless.UserService.loginWithTwitter(LoginActivity.this, new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
Intent intent = new Intent(LoginActivity.this, EndlessTaggingActivity.class);
startActivity(intent);
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(LoginActivity.this, fault.getMessage(), Toast.LENGTH_LONG).show();
}
});
}
});
}
Aggregations