Search in sources :

Example 46 with BackendlessFault

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));
    }
}
Also used : BackendlessFault(com.backendless.exceptions.BackendlessFault)

Example 47 with BackendlessFault

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));
    }
}
Also used : BackendlessFault(com.backendless.exceptions.BackendlessFault)

Example 48 with BackendlessFault

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));
    }
}
Also used : CollectionAdaptingPolicy(com.backendless.core.responder.policy.CollectionAdaptingPolicy) BackendlessFault(com.backendless.exceptions.BackendlessFault)

Example 49 with BackendlessFault

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));
    }
}
Also used : BackendlessFault(com.backendless.exceptions.BackendlessFault)

Example 50 with BackendlessFault

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));
    }
}
Also used : BackendlessFault(com.backendless.exceptions.BackendlessFault)

Aggregations

BackendlessFault (com.backendless.exceptions.BackendlessFault)65 AnonymousObject (weborb.reader.AnonymousObject)15 NamedObject (weborb.reader.NamedObject)15 AsyncCallback (com.backendless.async.callback.AsyncCallback)11 Intent (android.content.Intent)10 View (android.view.View)10 TextView (android.widget.TextView)6 BackendlessCollection (com.backendless.BackendlessCollection)6 List (java.util.List)6 Typeface (android.graphics.Typeface)5 BackendlessDataQuery (com.backendless.persistence.BackendlessDataQuery)5 EditText (android.widget.EditText)4 CollectionAdaptingPolicy (com.backendless.core.responder.policy.CollectionAdaptingPolicy)4 BackendlessFile (com.backendless.files.BackendlessFile)4 ArrayList (java.util.ArrayList)4 Button (android.widget.Button)3 GeoPoint (com.backendless.geo.GeoPoint)3 ProgressDialog (android.app.ProgressDialog)2 DialogInterface (android.content.DialogInterface)2 Bitmap (android.graphics.Bitmap)2