Skip to content

Commit cf4439d

Browse files
authored
Update README.md
1 parent ed7d7ea commit cf4439d

File tree

1 file changed

+83
-101
lines changed

1 file changed

+83
-101
lines changed

README.md

Lines changed: 83 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,47 @@
11
Cloudinary Android SDK
22
======================
3-
4-
Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline.
5-
6-
Easily upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software.
7-
Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your website’s graphics requirements.
8-
Images are seamlessly delivered through a fast CDN, and much much more.
9-
10-
Cloudinary offers comprehensive APIs and administration capabilities and is easy to integrate with any web application, existing or new.
11-
12-
Cloudinary provides URL and HTTP based APIs that can be easily integrated with any Web development framework.
13-
14-
## Requirements
15-
The library requires Android version 4.0.3 (Ice Cream Sandwich) and up.
16-
17-
## Gradle Integration
3+
[![Build Status](https://api.travis-ci.com/cloudinary/cloudinary_android.svg?branch=master)](https://app.travis-ci.com/github/cloudinary/cloudinary_android)
4+
5+
## About
6+
The Cloudinary Android SDK allows you to quickly and easily integrate your application with Cloudinary.
7+
Effortlessly optimize and transform your cloud's assets.
8+
9+
### Additional documentation
10+
This Readme provides basic installation and usage information.
11+
For the complete documentation, see the [Android SDK Guide](https://cloudinary.com/documentation/android_integration).
12+
13+
## Table of Contents
14+
- [Key Features](#key-features)
15+
- [Compatibility](#Version Support)
16+
- [Installation](#installation)
17+
- [Usage](#usage)
18+
- [Setup](#Setup)
19+
- [Transform and Optimize Assets](#Transforming and Optimizing Assets)
20+
- [Uploading Asset](#Uploading Assets)
21+
22+
## Key Features
23+
* [Image Transformation](https://cloudinary.com/documentation/android_image_manipulation)
24+
* [Video Transformation](https://cloudinary.com/documentation/android_video_manipulation)
25+
* [Direct File Upload](https://cloudinary.com/documentation/android_image_and_video_upload)
26+
* [Preprocess](https://cloudinary.com/documentation/android_image_and_video_upload#preprocess_uploads)
27+
* [Callbacks](https://cloudinary.com/documentation/android_image_and_video_upload#callbacks)
28+
* [Upload Policy](https://cloudinary.com/documentation/android_image_and_video_upload#upload_policy)
29+
* [Error Handling](https://cloudinary.com/documentation/advanced_url_delivery_options#error_handling)
30+
31+
## Version Support
32+
| Cloudinary SDK | Android SDK |
33+
|----------------|-------------|
34+
| 2.x | > 19 |
35+
| 1.x | > 14 |
36+
37+
38+
## Installation
39+
40+
### Gradle Integration
1841
Add the following dependency to your build.gradle:
1942

20-
`implementation group: 'com.cloudinary', name: 'cloudinary-android', version: '1.30.0'`
21-
## Manual Setup ######################################################################
22-
Download the latest Cloudinary Android SDK from [here](https://repo1.maven.org/maven2/com/cloudinary/cloudinary-android-core/1.30.0/cloudinary-android-core-1.30.0.aar) and the latest core version from [here](https://repo1.maven.org/maven2/com/cloudinary/cloudinary-core/1.29.0/cloudinary-core-1.29.0.jar) and put them in your libs folder.
23-
24-
## Maven Integration ######################################################################
43+
`implementation 'com.cloudinary:cloudinary-android:1.30.0'`
44+
### Other Options ######################################################################
2545
The cloudinary_android library is available in [Maven Central](http://repo1.maven.org/maven/). To use it, add the following dependency to your pom.xml:
2646

2747
<dependency>
@@ -30,61 +50,29 @@ The cloudinary_android library is available in [Maven Central](http://repo1.mave
3050
<version>1.30.0</version>
3151
</dependency>
3252

33-
34-
## Try it right away
35-
36-
Sign up for a [free account](https://cloudinary.com/users/register/free) so you can try out image transformations and seamless image delivery through CDN.
37-
38-
*Note: Replace `demo` in all the following examples with your Cloudinary's `cloud name`.*
39-
40-
Accessing an uploaded image with the `sample` public ID through a CDN:
41-
42-
http://res.cloudinary.com/demo/image/upload/sample.jpg
43-
44-
![Sample](https://res.cloudinary.com/demo/image/upload/w_0.4/sample.jpg "Sample")
45-
46-
Generating a 150x100 version of the `sample` image and downloading it through a CDN:
47-
48-
http://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill/sample.jpg
49-
50-
![Sample 150x100](https://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill/sample.jpg "Sample 150x100")
51-
52-
Converting to a 150x100 PNG with rounded corners of 20 pixels:
53-
54-
http://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill,r_20/sample.png
55-
56-
![Sample 150x150 Rounded PNG](https://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill,r_20/sample.png "Sample 150x150 Rounded PNG")
57-
58-
For plenty more transformation options, see our [image transformations documentation](http://cloudinary.com/documentation/image_transformations).
59-
60-
Generating a 120x90 thumbnail based on automatic face detection of the Facebook profile picture of Bill Clinton:
61-
62-
http://res.cloudinary.com/demo/image/facebook/c_thumb,g_face,h_90,w_120/billclinton.jpg
63-
64-
![Facebook 90x120](https://res.cloudinary.com/demo/image/facebook/c_thumb,g_face,h_90,w_120/billclinton.jpg "Facebook 90x200")
65-
66-
For more details, see our documentation for embedding [Facebook](http://cloudinary.com/documentation/facebook_profile_pictures) and [Twitter](http://cloudinary.com/documentation/twitter_profile_pictures) profile pictures.
53+
Download 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.
6754

6855

6956
## Usage
7057

71-
### Configuration
58+
### Setup
7259

73-
Each request for building a URL of a remote cloud resource must have the `cloud_name` parameter set.
74-
Setting the `cloud_name` parameter can be done either when initializing the library, or by using the CLOUDINARY_URL meta-data property in `AndroidManifest.xml`.
60+
Each request for building a URL of a remote cloud resource must have the `cloud_name` parameter set.
61+
You can set the `cloud_name` parameter either when initializing the library, or by using the CLOUDINARY_URL meta-data property in `AndroidManifest.xml`.
7562

7663
The entry point of the library is the `MediaManager` object. `MediaManager.init()` must be called before using the library, preferably in `Application.onCreate()`.
7764
Here's an example of setting the configuration parameters programmatically in your `Applicaion.onCreate(`:
78-
65+
7966
Map config = new HashMap();
8067
config.put("cloud_name", "myCloudName");
8168
MediaManager.init(this, config);
82-
83-
Alternatively, When using the meta-data property, no configuration is required:
84-
69+
70+
Alternatively, you can use the meta-data property. In that case, no configuration is required:
71+
8572
MediaManager.init(this);
8673

87-
The added property `AndroidManifest.xml`. Note: You should only include the `cloud_name` in the value, the api secret and key should be left out of the application.
74+
Only the cloud_name should be included. Your API key and secret aren't necessary.
75+
Note: Your API secret should never be exposed in the application.
8876

8977
<manifest>
9078
...
@@ -94,43 +82,37 @@ The added property `AndroidManifest.xml`. Note: You should only include the `clo
9482
</application>
9583
<manifest>
9684

97-
98-
99-
### Embedding and transforming images
85+
### Transforming and Optimizing Assets
10086

10187
Any image uploaded to Cloudinary can be transformed and embedded using powerful view helper methods:
10288

10389
The following example generates the url for accessing an uploaded `sample` image while transforming it to fill a 100x150 rectangle:
10490

10591
MediaManager.get().url().transformation(new Transformation().width(100).height(150).crop("fill")).generate("sample.jpg")
10692

107-
Another example, embedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:
93+
Another example, embedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:
10894

10995
MediaManager.get().url().transformation(new Transformation().width(90).height(90).crop("thumb").gravity("face")).generate("woman.jpg")
11096

111-
You can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.
112-
97+
You can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.
98+
11399
Embedding a Facebook profile to match your graphic design is very simple:
114100

115101
MediaManager.get().url().type("facebook").transformation(new Transformation().width(130).height(130).crop("fill").gravity("north_west")).generate("billclinton.jpg")
116-
117-
Same goes for Twitter:
118102

119-
MediaManager.get().url().type("twitter_name").generate("billclinton.jpg")
103+
### Uploading Assets
120104

121-
### Uploading
122-
123-
The entry point for upload operations is the `MediaManager.get().upload()` call. All upload operations are dispatched to a background queue, with
105+
The entry point for upload operations is the `MediaManager.get().upload()` call. All upload operations are dispatched to a background queue, with
124106
a set of fully customizable rules and limits letting you choose when each upload request should actually run. Requests are automatically rescheduled to be
125107
retried later if a recoverable error is encountered (e.g. network disconnections, timeouts).
126108

127109
The upload results are dispatched asynchronously using `UploadCallback`. Global callbacks can be defined, as well as specific callbacks per request.
128-
Note: 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).
110+
Note: 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).
129111

130112
The following examples uploads a `File` using the default settings, a request upload callback, and an upload preset (more about upload presets below):
131-
113+
132114
String requestId = MediaManager.get().upload(imageFile).unsigned("sample_preset").callback(callback).dispatch();
133-
115+
134116
The 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`.
135117

136118
The 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:
@@ -140,7 +122,7 @@ The uploaded image is assigned a randomly generated public Id. As soon as `onSuc
140122
http://res.cloudinary.com/demo/image/upload/abcfrmo8zul1mafopawefg.jpg
141123

142124
You can also specify your own public ID:
143-
125+
144126
String requestId = MediaManager.get().upload(uri).unsigned("sample_preset").option("public_id", "sample_remote").dispatch();
145127

146128
Using `RequestUploadPolicy`, an upload request can be configured to run under specific circumstance, or within a chosen time window:
@@ -156,7 +138,7 @@ The following examples uploads local Uri resource, configured to run immediately
156138
For security reasons, mobile applications cannot contain the full account credentials, and so they cannot freely upload resources to the cloud.
157139
Cloudinary provides two different mechanisms to enable end-users to upload resources without providing full credentials.
158140

159-
##### 1. Unsigned uploads using [Upload Presets.](http://cloudinary.com/blog/centralized_control_for_image_upload_image_size_format_thumbnail_generation_tagging_and_more)
141+
##### 1. Unsigned uploads using [Upload Presets.](https://cloudinary.com/documentation/android_image_and_video_upload)
160142
You can create an upload preset in your Cloudinary account console, defining rules that limit the formats, transformations, dimensions and more.
161143
Once 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.
162144

@@ -165,7 +147,7 @@ The following example uploads a local resource, available as a Uri, assuming a p
165147
String requestId = MediaManager.get().upload(uri).unsigned("sample_preset").dispatch();
166148

167149
##### 2. Signed uploads with server-based signature
168-
Another way to allow uploading without credentials is using signed uploads.
150+
Another way to allow uploading without credentials is using signed uploads.
169151
It is recommended to generate the upload authentication signature on the server side, where it's safe to store the `api_secret`.
170152

171153
Cloudinary'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).
@@ -179,7 +161,7 @@ Your server can use any Cloudinary libraries (Ruby on Rails, PHP, Python & Djang
179161
"api_key": "123456789012345"
180162
}
181163

182-
When initializing `MediaManager`, a `SignatureProvider` can be sent. Whenever an upload requires signing, the library will call the provider's `provideSignature()` method,
164+
When initializing `MediaManager`, a `SignatureProvider` can be sent. Whenever an upload requires signing, the library will call the provider's `provideSignature()` method,
183165
where 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:
184166

185167
MediaManager.init(this, new SignatureProvider() {
@@ -188,29 +170,29 @@ where you should implement the call to your server's signing endpoint. This call
188170
// call server signature endpoint
189171
}
190172
}, null);
191-
192-
193-
## Additional resources ##########################################################
194-
195-
Additional resources are available at:
196-
197-
* [Website](http://cloudinary.com)
198-
* [Documentation](http://cloudinary.com/documentation)
199-
* [Image transformations documentation](http://cloudinary.com/documentation/image_transformations)
200-
* [Upload API documentation](http://cloudinary.com/documentation/upload_images)
201-
202-
## Support
203-
204-
You can [open an issue through GitHub](https://github.com/cloudinary/cloudinary_android/issues).
205173

206-
Contact us at [[email protected]](mailto:[email protected])
174+
## Contributions
175+
See [contributing guidelines](/CONTRIBUTING.md).
207176

208-
Or via Twitter: [@cloudinary](https://twitter.com/#!/cloudinary)
177+
## Get Help
178+
If you run into an issue or have a question, you can either:
179+
- [Open a Github issue](https://github.com/cloudinary/cloudinary_android/issues) (for issues related to the SDK)
180+
- [Open a support ticket](https://cloudinary.com/contact) (for issues related to your account)
209181

210-
## Join the Community ##########################################################
182+
## About Cloudinary
183+
Cloudinary 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.
211184

212-
Impact the product, hear updates, test drive new features and more! Join [here](https://www.facebook.com/groups/CloudinaryCommunity).
185+
## Additional resources
213186

214-
## License #######################################################################
187+
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references): Comprehensive references, including syntax and examples for all SDKs.
188+
- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers
189+
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on YouTube.
190+
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and on-site courses.
191+
- [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.
192+
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should develop next.
193+
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to other Cloudinary developers.
194+
- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.
195+
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.
215196

216-
Released under the MIT license.
197+
## Licence
198+
Released under the MIT license.

0 commit comments

Comments
 (0)