本文整理汇总了Java中com.backendless.exceptions.BackendlessFault类的典型用法代码示例。如果您正苦于以下问题:Java BackendlessFault类的具体用法?Java BackendlessFault怎么用?Java BackendlessFault使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BackendlessFault类属于com.backendless.exceptions包,在下文中一共展示了BackendlessFault类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: subscribeToPushChannel
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
@Override
public boolean subscribeToPushChannel(final String channel) {
if (!BNetworkManager.sharedManager().getNetworkAdapter().backendlessEnabled())
return false;
try {
Backendless.Messaging.registerDevice(context.getString(R.string.google_project_number), channel, new AsyncCallback<Void>() {
@Override
public void handleResponse(Void response) {
if(DEBUG) Timber.v("Device has been subscribed to channel " + channel);
}
@Override
public void handleFault(BackendlessFault fault) {
if(DEBUG) Timber.v("Device subscription failed. " + fault.getMessage());
}
});
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
示例2: onRestorePasswordButtonClicked
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
private void onRestorePasswordButtonClicked() {
if (etEmail.getText().toString().equals("")) {
etEmail.setError(getString(R.string.error_email));
return;
}
Backendless.UserService.restorePassword(etEmail.getText().toString(),
new AsyncCallback<Void>() {
@Override
public void handleResponse(Void response) {
Toast.makeText(RestorePasswordActivity.this,
R.string.restore_email_sent,
Toast.LENGTH_SHORT).show();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(RestorePasswordActivity.this,
getString(R.string.restore_email_fail),
Toast.LENGTH_SHORT).show();
}
});
}
示例3: onLoginWithFacebookButtonClicked
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
public void onLoginWithFacebookButtonClicked() {
Map<String, String> fieldMap = new HashMap<>();
fieldMap.put("name", "name");
fieldMap.put("gender", "gender");
fieldMap.put("email", "email");
List<String> facebookPermissions = new ArrayList<>();
facebookPermissions.add("email");
Backendless.UserService.loginWithFacebook(LoginActivity.this, null, fieldMap, facebookPermissions,
new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
Toast.makeText(LoginActivity.this, R.string.fb_login_success,
Toast.LENGTH_SHORT).show();
loginSuccess();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(LoginActivity.this, getString(R.string.login_fail),
Toast.LENGTH_SHORT).show();
}
});
}
示例4: onLoginWithGoogleButtonClicked
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
private void onLoginWithGoogleButtonClicked() {
Map<String, String> fieldMap = new HashMap<>();
fieldMap.put("name", "name");
fieldMap.put("gender", "gender");
fieldMap.put("email", "email");
List<String> googlePermissions = new ArrayList<>();
Backendless.UserService.loginWithGooglePlus(LoginActivity.this, null, fieldMap, googlePermissions,
new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
Toast.makeText(LoginActivity.this, R.string.google_login_success,
Toast.LENGTH_SHORT).show();
loginSuccess();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(LoginActivity.this, getString(R.string.login_fail),
Toast.LENGTH_SHORT).show();
}
});
}
示例5: onLoginButtonClicked
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
private void onLoginButtonClicked() {
Backendless.UserService.login(etEmail.getText().toString(),
etPassword.getText().toString(),
new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
Toast.makeText(LoginActivity.this, R.string.email_login_success,
Toast.LENGTH_SHORT).show();
loginSuccess();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(LoginActivity.this, getString(R.string.login_fail) + fault.getMessage(),
Toast.LENGTH_SHORT).show();
}
}, checkboxRemember.isChecked());
}
示例6: getCategory
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
public void getCategory()
{
progressDialog = ProgressDialog.show( EndlessTaggingActivity.this, "", "Loading", true );
Backendless.Geo.getCategories( new AsyncCallback<List<GeoCategory>>()
{
@Override
public void handleResponse( List<GeoCategory> geoCategories )
{
List<GeoCategory> categories = geoCategories;
for( GeoCategory category : categories )
categoriesNames.add( category.getName() );
searchRectanglePoints( selectedCategories.isEmpty() ? categoriesNames : selectedCategories );
progressDialog.cancel();
}
@Override
public void handleFault( BackendlessFault backendlessFault )
{
progressDialog.cancel();
Toast.makeText( EndlessTaggingActivity.this, backendlessFault.getMessage(), Toast.LENGTH_LONG ).show();
}
} );
}
示例7: onRegisterButtonClicked
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
private void onRegisterButtonClicked() {
if (etEmail.getText().toString().equals("")) {
etEmail.setError(getString(R.string.error_email));
return;
}
if (etPassword.getText().toString().equals("")) {
etEmail.setError(getString(R.string.error_pass));
return;
}
BackendlessUser newUser = new BackendlessUser();
newUser.setEmail(etEmail.getText().toString());
newUser.setProperty("name", etName.getText().toString());
newUser.setPassword(etPassword.getText().toString());
Backendless.UserService.register(newUser, new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
Toast.makeText(RegisterActivity.this, R.string.register_success,
Toast.LENGTH_SHORT).show();
startActivity(new Intent(RegisterActivity.this, LoginActivity.class));
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(RegisterActivity.this, R.string.register_fail,
Toast.LENGTH_SHORT).show();
}
});
}
示例8: uploadImagetoOnlineDb
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
public void uploadImagetoOnlineDb(String _currentDate){
context.registerReceiver(this.mBatInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
ArrayList<String> _tags = sapphireImgDbHelper.getAllTags();
for(String eleTags : _tags){
byte[] b_Array = sapphireImgDbHelper.imgquery(eleTags);
Backendless.Files.saveFile(kapacRecentDB.queryPackage()+"/img_data", eleTags + ".png", b_Array, true, new AsyncCallback<String>() {
@Override
public void handleResponse(String s) {
Log.d("VamHan",""+s);
}
@Override
public void handleFault(BackendlessFault backendlessFault) {
Log.d("VamHan",""+backendlessFault.getMessage());
}
});
}
if(uploadDateStoreDb.retrieveValue() == null){
//new Data
uploadDateStoreDb.insertNewDate(_currentDate);
}else{
SimpleDateFormat sdf = new SimpleDateFormat("[yyyy/MM/dd - HH:mm:ss]");
try {
Date Pdate = sdf.parse(uploadDateStoreDb.retrieveValue());
Date Cdate = sdf.parse(_currentDate);
int getDif = printDifference(Pdate, Cdate);
if(getDif == 3){
if(batteryStatus.isBatteryStatus() && batteryStatus.getBatteryPercentage() > 20) {
Log.d("NakedandFam","Approved");
uploadDateStoreDb.clearTable();
uploadDateStoreDb.insertNewDate(_currentDate);
}
}
} catch (ParseException e) {
e.printStackTrace();
}
}
}
示例9: searchRectanglePoints
import com.backendless.exceptions.BackendlessFault; //导入依赖的package包/类
private void searchRectanglePoints( List<String> categoriesNames )
{
final ProgressBar progressBar = (ProgressBar) findViewById( R.id.progressBar );
final TextView textView = (TextView) findViewById( R.id.textLoading );
textView.setVisibility( TextView.VISIBLE );
progressBar.setVisibility( ProgressBar.VISIBLE );
backendlessGeoQuery = new BackendlessGeoQuery();
backendlessGeoQuery.setSearchRectangle( new double[] { NELat, SWLon, SWLat, NELon } );
backendlessGeoQuery.setCategories( categoriesNames );
Backendless.Geo.getPoints( backendlessGeoQuery, new AsyncCallback<BackendlessCollection<GeoPoint>>()
{
@Override
public void handleResponse( BackendlessCollection<GeoPoint> geoPointBackendlessCollection )
{
List<GeoPoint> points = geoPointBackendlessCollection.getCurrentPage();
double newLatitude, newLongitude;
adapter.clear();
if( !points.isEmpty() )
adapter.addAll( points );
adapter.notifyDataSetChanged();
for( GeoPoint point : points )
{
newLatitude = point.getLatitude();
newLongitude = point.getLongitude();
Map<String, String> newMetaData = point.getMetadata();
String endlessTagging = newMetaData.get( "endlessTagging" );
if( endlessTagging != null )
{
String pointName = newMetaData.get( "pointName" );
String pointDescription = newMetaData.get( "pointDescription" );
LatLng newPosition = new LatLng( newLatitude, newLongitude );
googleMap.addMarker( new MarkerOptions().position( newPosition ).title( pointName ).snippet( pointDescription ).icon( BitmapDescriptorFactory.fromResource( R.drawable.marker_blue ) ) );
}
}
textView.setVisibility( TextView.INVISIBLE );
progressBar.setVisibility( ProgressBar.INVISIBLE );
}
@Override
public void handleFault( BackendlessFault backendlessFault )
{
textView.setVisibility( TextView.INVISIBLE );
progressBar.setVisibility( ProgressBar.INVISIBLE );
Toast.makeText( EndlessTaggingActivity.this, backendlessFault.getMessage(), Toast.LENGTH_LONG ).show();
}
} );
}