use of com.backendless.exceptions.BackendlessFault in project Android-SDK by Backendless.
the class FilesAndroidExtra method upload.
public void upload(final Bitmap bitmap, final Bitmap.CompressFormat compressFormat, final int quality, String name, String path, boolean overwrite, final AsyncCallback<BackendlessFile> responder) {
try {
checkBitmapAndPath(bitmap, compressFormat, path);
new UploadBitmapAsyncTask().executeThis(bitmap, compressFormat, quality, name, path, overwrite, 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 Geo method addCategory.
public void addCategory(String categoryName, AsyncCallback<GeoCategory> responder) {
try {
checkCategoryName(categoryName);
Invoker.invokeAsync(GEO_MANAGER_SERVER_ALIAS, "addCategory", new Object[] { categoryName }, 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 Geo method relativeFind.
public void relativeFind(final BackendlessGeoQuery geoQuery, final AsyncCallback<List<SearchMatchesResult>> responder) {
try {
if (geoQuery == null)
throw new IllegalArgumentException(ExceptionMessage.NULL_GEO_QUERY);
if (geoQuery.getRelativeFindMetadata().isEmpty() || geoQuery.getRelativeFindPercentThreshold() == 0)
throw new IllegalArgumentException(ExceptionMessage.INCONSISTENT_GEO_RELATIVE);
CollectionAdaptingPolicy<SearchMatchesResult> adaptingPolicy = new CollectionAdaptingPolicy<>();
Invoker.invokeAsync(GEO_MANAGER_SERVER_ALIAS, "relativeFind", new Object[] { geoQuery }, new AsyncCallback<List<SearchMatchesResult>>() {
@Override
public void handleResponse(List<SearchMatchesResult> response) {
if (responder != null)
responder.handleResponse(response);
}
@Override
public void handleFault(BackendlessFault fault) {
if (responder != null)
responder.handleFault(fault);
}
}, new AdaptingResponder<>(SearchMatchesResult.class, adaptingPolicy));
} 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 Geo method getGeopointCount.
public void getGeopointCount(String geoFenceName, BackendlessGeoQuery query, AsyncCallback<Integer> responder) {
try {
Object[] args = new Object[] { geoFenceName, query };
Invoker.invokeAsync(GEO_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 Geo method deleteCategory.
public void deleteCategory(String categoryName, AsyncCallback<Boolean> responder) {
try {
checkCategoryName(categoryName);
Invoker.invokeAsync(GEO_MANAGER_SERVER_ALIAS, "deleteCategory", new Object[] { categoryName }, responder);
} catch (Throwable e) {
if (responder != null)
responder.handleFault(new BackendlessFault(e));
}
}
Aggregations