You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
### Other Options ######################################################################
25
45
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:
26
46
27
47
<dependency>
@@ -30,61 +50,29 @@ The cloudinary_android library is available in [Maven Central](http://repo1.mave
30
50
<version>1.30.0</version>
31
51
</dependency>
32
52
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:
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.
67
54
68
55
69
56
## Usage
70
57
71
-
### Configuration
58
+
### Setup
72
59
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`.
75
62
76
63
The entry point of the library is the `MediaManager` object. `MediaManager.init()` must be called before using the library, preferably in `Application.onCreate()`.
77
64
Here's an example of setting the configuration parameters programmatically in your `Applicaion.onCreate(`:
78
-
65
+
79
66
Map config = new HashMap();
80
67
config.put("cloud_name", "myCloudName");
81
68
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
+
85
72
MediaManager.init(this);
86
73
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.
88
76
89
77
<manifest>
90
78
...
@@ -94,43 +82,37 @@ The added property `AndroidManifest.xml`. Note: You should only include the `clo
94
82
</application>
95
83
<manifest>
96
84
97
-
98
-
99
-
### Embedding and transforming images
85
+
### Transforming and Optimizing Assets
100
86
101
87
Any image uploaded to Cloudinary can be transformed and embedded using powerful view helper methods:
102
88
103
89
The following example generates the url for accessing an uploaded `sample` image while transforming it to fill a 100x150 rectangle:
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
124
106
a set of fully customizable rules and limits letting you choose when each upload request should actually run. Requests are automatically rescheduled to be
125
107
retried later if a recoverable error is encountered (e.g. network disconnections, timeouts).
126
108
127
109
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).
129
111
130
112
The following examples uploads a `File` using the default settings, a request upload callback, and an upload preset (more about upload presets below):
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`.
135
117
136
118
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
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
156
138
For security reasons, mobile applications cannot contain the full account credentials, and so they cannot freely upload resources to the cloud.
157
139
Cloudinary provides two different mechanisms to enable end-users to upload resources without providing full credentials.
158
140
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)
160
142
You can create an upload preset in your Cloudinary account console, defining rules that limit the formats, transformations, dimensions and more.
161
143
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.
162
144
@@ -165,7 +147,7 @@ The following example uploads a local resource, available as a Uri, assuming a p
##### 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.
169
151
It is recommended to generate the upload authentication signature on the server side, where it's safe to store the `api_secret`.
170
152
171
153
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
179
161
"api_key": "123456789012345"
180
162
}
181
163
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,
183
165
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:
184
166
185
167
MediaManager.init(this, new SignatureProvider() {
@@ -188,29 +170,29 @@ where you should implement the call to your server's signing endpoint. This call
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)
209
181
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.
211
184
212
-
Impact the product, hear updates, test drive new features and more! Join [here](https://www.facebook.com/groups/CloudinaryCommunity).
-[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.
-[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.
0 commit comments