0

I m trying to list all images from cloudinary using the below code but I get "Not implemented Exception"

   Map config = ObjectUtils.asMap(
            "cloud_name", Config.CLOUDINARY_CLOUD_NAME,
            "api_key", Config.CLOUDINARY_API_KEY,
            "api_secret", Config.CLOUDINARY_API_SECRET);

    Cloudinary cloudinary = new Cloudinary(config);
    Api api = cloudinary.api();
    Map result;
    try {
        result = api.resources(ObjectUtils.emptyMap());
    } catch (Exception e) {
        e.printStackTrace();
    }

Which seems to be coming from

   public ApiResponse callApi(HttpMethod method, Iterable<String> uri, Map<String, ? extends Object> params, Map options) throws Exception {
        throw new Exception("not implemented");
    }

// function parameter values
    this = {ApiStrategy@4487} 
     api = {Api@4499} 
     shadow$_klass_ = {Class@4338} "class com.cloudinary.android.ApiStrategy"
     shadow$_monitor_ = -2091658589
    method = {Api$HttpMethod@4395} "GET"
     name = {String@4396} "GET"
     ordinal = 0
     shadow$_klass_ = {Class@4382} "class com.cloudinary.Api$HttpMethod"
     shadow$_monitor_ = -2098674761
    uri = {ArrayList@4505}  size = 2
     0 = {String@4400} "resources"
     1 = {String@4374} "image"
    params = {HashMap@4516}  size = 0
    options = {Collections$EmptyMap@4371}  size = 0
Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126

1 Answers1

0

Since Android is a client-side environment and the Admin-API is designated to serve on the server-side, its methods are not implemented for native Android.

Having said that, you can build the HTTP request on your own, using the ADMIN-API endpoint, and issue it in order to collect the information you require. For more info regarding end points and constructing of the HTTP request, see Cloudinary's docs: http://cloudinary.com/documentation/admin_api

Nadav Ofir
  • 778
  • 4
  • 6