{"id":19444187,"url":"https://github.com/cloudinary/cloudinary_android","last_synced_at":"2025-04-04T06:08:51.351Z","repository":{"id":8023305,"uuid":"9432373","full_name":"cloudinary/cloudinary_android","owner":"cloudinary","description":"Android client for integrating with Cloudinary","archived":false,"fork":false,"pushed_at":"2024-10-20T17:01:43.000Z","size":2107,"stargazers_count":68,"open_issues_count":12,"forks_count":60,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-03-28T05:12:24.130Z","etag":null,"topics":["android","android-library","cloudinary","cloudinary-android-sdk","cloudinary-sdk","hacktoberfest","image-manipulation","sdk-android","video-manipulation"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudinary.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-14T17:24:34.000Z","updated_at":"2025-02-27T07:37:49.000Z","dependencies_parsed_at":"2024-01-07T07:24:32.981Z","dependency_job_id":"5c763df4-f30d-40a4-9a80-7cbe3ff92aa8","html_url":"https://github.com/cloudinary/cloudinary_android","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary_android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary_android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary_android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary_android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudinary","download_url":"https://codeload.github.com/cloudinary/cloudinary_android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128751,"owners_count":20888235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","cloudinary","cloudinary-android-sdk","cloudinary-sdk","hacktoberfest","image-manipulation","sdk-android","video-manipulation"],"created_at":"2024-11-10T16:05:28.484Z","updated_at":"2025-04-04T06:08:51.330Z","avatar_url":"https://github.com/cloudinary.png","language":"Java","readme":"Cloudinary Android SDK\n======================\n[![Build Status](https://api.travis-ci.com/cloudinary/cloudinary_android.svg?branch=master)](https://app.travis-ci.com/github/cloudinary/cloudinary_android)\n\n## About\nThe Cloudinary Android SDK allows you to quickly and easily integrate your application with Cloudinary.\nEffortlessly optimize and transform your cloud's assets.\n\n### Additional documentation\nThis Readme provides basic installation and usage information.\nFor the complete documentation, see the [Android SDK Guide](https://cloudinary.com/documentation/android_integration).\n\n## Table of Contents\n- [Key Features](#Key-Features)\n- [Compatibility](#Version-Support)\n- [Installation](#Installation)\n- [Usage](#Usage)\n    - [Setup](#Setup)\n    - [Transform and Optimize Assets](#Transforming-and-Optimizing-Assets)\n    - [Uploading Asset](#Uploading-Assets)\n\n## Key Features\n* [Image Transformation](https://cloudinary.com/documentation/android_image_manipulation)\n* [Video Transformation](https://cloudinary.com/documentation/android_video_manipulation)\n* [Direct File Upload](https://cloudinary.com/documentation/android_image_and_video_upload)\n* [Preprocess](https://cloudinary.com/documentation/android_image_and_video_upload#preprocess_uploads)\n* [Callbacks](https://cloudinary.com/documentation/android_image_and_video_upload#callbacks)\n* [Upload Policy](https://cloudinary.com/documentation/android_image_and_video_upload#upload_policy)\n* [Error Handling](https://cloudinary.com/documentation/advanced_url_delivery_options#error_handling)\n\n## Version Support\n| Cloudinary SDK | Android SDK | \n|----------------|-------------|\n| 3.x            | \u003e 21        |\n| 2.x            | \u003e 19        |\n| 1.x            | \u003e 14        |\n\n\n## Installation\n\n### Gradle Integration\nAdd the following dependency to your build.gradle:\n\n`implementation 'com.cloudinary:cloudinary-android:3.0.2'`\n### Other Options ######################################################################\nThe cloudinary_android library is available in [Maven Central](http://repo1.maven.org/maven/). To use it, add the following dependency to your pom.xml:\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.cloudinary\u003c/groupId\u003e\n        \u003cartifactId\u003ecloudinary-android\u003c/artifactId\u003e\n        \u003cversion\u003e3.0.2\u003c/version\u003e\n    \u003c/dependency\u003e\n\nDownload the latest cloudinary-android from [here](https://mvnrepository.com/artifact/com.cloudinary/cloudinary-android-core) and the latest cloudinary-core from [here](https://mvnrepository.com/artifact/com.cloudinary/cloudinary-core) and put them in your libs folder.\n\n\n## Usage\n\n### Setup\n\nEach request for building a URL of a remote cloud resource must have the `cloud_name` parameter set.\nYou can set the `cloud_name` parameter either when initializing the library, or by using the CLOUDINARY_URL meta-data property in `AndroidManifest.xml`.\n\nThe entry point of the library is the `MediaManager` object. `MediaManager.init()` must be called before using the library, preferably in `Application.onCreate()`.\nHere's an example of setting the configuration parameters programmatically in your `Applicaion.onCreate(`:\n\n     Map config = new HashMap();\n     config.put(\"cloud_name\", \"myCloudName\");\n     MediaManager.init(this, config);\n\nAlternatively, you can use the meta-data property. In that case, no configuration is required:\n\n    MediaManager.init(this);\n\nOnly the cloud_name should be included. Your API key and secret aren't necessary.\nNote: Your API secret should never be exposed in the application.\n\n    \u003cmanifest\u003e\n        ...\n        \u003capplication\u003e\n            ...\n            \u003cmeta-data android:name=\"CLOUDINARY_URL\" android:value=\"cloudinary://@myCloudName\"/\u003e\n        \u003c/application\u003e\n    \u003cmanifest\u003e\n\n### Transforming and Optimizing Assets\n\nAny image uploaded to Cloudinary can be transformed and embedded using powerful view helper methods:\n\nThe following example generates the url for accessing an uploaded `sample` image while transforming it to fill a 100x150 rectangle:\n\n    MediaManager.get().url().transformation(new Transformation().width(100).height(150).crop(\"fill\")).generate(\"sample.jpg\")\n\nAnother example, embedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:\n\n    MediaManager.get().url().transformation(new Transformation().width(90).height(90).crop(\"thumb\").gravity(\"face\")).generate(\"woman.jpg\")\n\nIf your application is written in Kotlin you can use the syntax below:\n\n    MediaManager.get().url().transformation(Transformation\u003cTransformation\u003c*\u003e\u003e().width(90).height(90).crop(\"thumb\").gravity(\"face\")).generate(\"woman.jpg\")\n\nYou can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.\n\nEmbedding a Facebook profile to match your graphic design is very simple:\n\n    MediaManager.get().url().type(\"facebook\").transformation(new Transformation().width(130).height(130).crop(\"fill\").gravity(\"north_west\")).generate(\"billclinton.jpg\")\n\n### Uploading Assets\n\nThe entry point for upload operations is the `MediaManager.get().upload()` call. All upload operations are dispatched to a background queue, with\na set of fully customizable rules and limits letting you choose when each upload request should actually run. Requests are automatically rescheduled to be\nretried later if a recoverable error is encountered (e.g. network disconnections, timeouts).\n\nThe upload results are dispatched asynchronously using `UploadCallback`. Global callbacks can be defined, as well as specific callbacks per request.\nNote: In order to receive global callbacks even when the app is already shut down, or in the background, the `ListenerService` class can be extended and registered in the manifest (see the class for further instructions).\n\nThe following examples uploads a `File`  using the default settings, a request upload callback, and an upload preset (more about upload presets below):\n\n    String requestId = MediaManager.get().upload(imageFile).unsigned(\"sample_preset\").callback(callback).dispatch();\n\nThe returned `requestId` is used to identify the request in global callbacks and to cancel the request if needed. The callback should be any implementation of `UploadCallback`.\n\nThe uploaded image is assigned a randomly generated public Id. As soon as `onSuccess` is called, the image is immediately available for download through a CDN:\n\n    MediaManager.get().url().generate(\"abcfrmo8zul1mafopawefg.jpg\")\n      \n    http://res.cloudinary.com/demo/image/upload/abcfrmo8zul1mafopawefg.jpg\n\nYou can also specify your own public ID:\n\n    String requestId = MediaManager.get().upload(uri).unsigned(\"sample_preset\").option(\"public_id\", \"sample_remote\").dispatch();\n\nUsing `RequestUploadPolicy`, an upload request can be configured to run under specific circumstance, or within a chosen time window:\n\nThe following examples uploads local Uri resource, configured to run immediately (the default), with a maximum of 7 retries, and only on an unmetered network (e.g. wifi):\n\n    String requestId = MediaManager.get().upload(uri)\n        .unsigned(\"sample_app_preset\")\n        .constrain(TimeWindow.immediate())\n        .policy(new RequestUploadPolicy.Builder().maxRetries(7).networkPolicy(RequestUploadPolicy.NetworkType.UNMETERED).build())\n        .dispatch();\n\nFor security reasons, mobile applications cannot contain the full account credentials, and so they cannot freely upload resources to the cloud.\nCloudinary provides two different mechanisms to enable end-users to upload resources without providing full credentials.\n\n##### 1. Unsigned uploads using [Upload Presets.](https://cloudinary.com/documentation/android_image_and_video_upload)\nYou can create an upload preset in your Cloudinary account console, defining rules that limit the formats, transformations, dimensions and more.\nOnce the preset is defined, it's name is supplied when calling upload. An upload call will only succeed if the preset name is used and the resource is within the preset's pre-defined limits.\n\nThe following example uploads a local resource, available as a Uri, assuming a preset named 'sample_preset' already exists in the account:\n\n    String requestId = MediaManager.get().upload(uri).unsigned(\"sample_preset\").dispatch();\n\n##### 2. Signed uploads with server-based signature\nAnother way to allow uploading without credentials is using signed uploads.\nIt is recommended to generate the upload authentication signature on the server side, where it's safe to store the `api_secret`.\n\nCloudinary's Android SDK allows providing server-generated signature and any additional parameters that were generated on the server side (instead of signing using `api_secret` locally).\n\nYour server can use any Cloudinary libraries (Ruby on Rails, PHP, Python \u0026 Django, Java, Perl, .Net, etc.) for generating the signature. The following JSON in an example of a response of an upload authorization request to your server:\n\n\t{\n\t  \"signature\": \"sgjfdoigfjdgfdogidf9g87df98gfdb8f7d6gfdg7gfd8\",\n\t  \"public_id\": \"abdbasdasda76asd7sa789\",\n\t  \"timestamp\": 1346925631,\n\t  \"api_key\": \"123456789012345\"\n\t}\n\nWhen initializing `MediaManager`, a `SignatureProvider` can be sent. Whenever an upload requires signing, the library will call the provider's `provideSignature()` method,\nwhere you should implement the call to your server's signing endpoint. This callback runs on a background a thread so there's no need to handle threading:\n\n    MediaManager.init(this, new SignatureProvider() {\n        @Override\n        public Signature provideSignature(Map options) {\n            // call server signature endpoint\n        }\n    }, null);\n\n## Contributions\nSee [contributing guidelines](/CONTRIBUTING.md).\n\n## Get Help\nIf you run into an issue or have a question, you can either:\n- [Open a Github issue](https://github.com/cloudinary/cloudinary_android/issues) (for issues related to the SDK)\n- [Open a support ticket](https://cloudinary.com/contact) (for issues related to your account)\n\n## About Cloudinary\nCloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiences—irrespective of the viewing device.\n\n## Additional resources\n\n- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references): Comprehensive references, including syntax and examples for all SDKs.\n- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers\n- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on YouTube.\n- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and on-site courses.\n- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop for all code explorers, Postman collections, and feature demos found in the docs.\n- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should develop next.\n- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to other Cloudinary developers.\n- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.\n- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.\n\n## Licence\nReleased under the MIT license.\n","funding_links":[],"categories":["Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fcloudinary_android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudinary%2Fcloudinary_android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fcloudinary_android/lists"}