-
Notifications
You must be signed in to change notification settings - Fork 28
Starter guide for Android SDK #187
base: master
Are you sure you want to change the base?
Starter guide for Android SDK #187
Conversation
AniVerma17
commented
Sep 26, 2023
- Add the quick start guide to document the steps of installing and using the ImageKit Android SDK.
- Update the summary file to add the link of the Android SDK guide.
|
|
||
| ## Rendering Images in Android application | ||
|
|
||
| Image URL can be created from an image path or using the absolute image URL. You can learn more about it in [docs](https://github.com/imagekit-developer/imagekit-javascript#url-generation). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we linking javascript SDK here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the hyperlink.
| // https://ik.imagekit.io/your_imagekit_id/default-image.jpg?tr=h-400,ar-3-2 | ||
| ``` | ||
|
|
||
| It will look as shown below. In the sample app, the buttons are present to demonstrate the use of different transformations. \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no screenshot right below this. Looks a bit confusing to me. Also there is unwanted \ at the end of this sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| ### **Upload policy** | ||
|
|
||
| The [UploadPolicy](https://github.com/imagekit-developer/imagekit-android/blob/master/README.md#uploadpolicy) class represents a set of conditions that need to be met for an upload request to be executed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add more details here as to cover why someone might need upload policy in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| The `ImageKitUploader` can also perform the preprocessing of the image/video to modify them before uploading, by passing an instance of [ImageUploadPreprocessor](https://github.com/imagekit-developer/imagekit-android/blob/master/README.md#image-preprocessing)/[VideoUploadPreprocessor](https://github.com/imagekit-developer/imagekit-android/blob/master/README.md#video-preprocessing). | ||
|
|
||
| Currently, follwing processes can be applied by upload preprocessors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add more details to cover the use-case e.g. optimize imagekit storage by avoiding upload of large files, speed up upload request etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| ## Integrations with third-party libraries | ||
|
|
||
| ImageKit Android SDK also provides library extensions for integrations with the following image loading libraries for Android: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This heading should be hyper linked in rendering images section IMO. We can do that in the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the hyperlink to this section at the end of rendering images section.
| ## **Clone and run the tutorial app** | ||
|
|
||
| For this tutorial, we have used our sample Android app as shown below. If you have your own existing Android app, you can integrate the ImageKit Android SDK to it, the instructions for which are provided in the subsequent sections. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a line before the git clone command
Clone tutorial app repository with the following command
|
|
||
| #### Initializing the SDK | ||
|
|
||
| Initialize our SDK prefereable in the `Application` class or any `Activity` as needed, with the following code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Initialize our SDK prefereable in the `Application` class or any `Activity` as needed, with the following code: | |
| Initialize our SDK preferably in the `Application` class or any `Activity` as needed, with the following code: |
| git clone https://github.com/imagekit-samples/quickstart.git | ||
| ``` | ||
|
|
||
| Open the `android` folder within the cloned repository in Android Studio, and run Gradle sync to install the dependencies that are needed to run the Android app. Then run the app by selecting your target device/emulator and clicking on the Run button in Studio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems a little confusing and too many things at once
| Open the `android` folder within the cloned repository in Android Studio, and run Gradle sync to install the dependencies that are needed to run the Android app. Then run the app by selecting your target device/emulator and clicking on the Run button in Studio. | |
| Once you've cloned the repository, open `android` folder in Android Studio. Perform Gradle sync to install all the necessary dependencies for the Android app. After the sync, run the app by selecting your target device/emulator and clicking on the `Run` button in Studio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edited the text for better clarity of each step.
| You should see the following screen. This means the sample app has been set up correctly. | ||
|
|
||
|  | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing section Setup ImageKit Android SDK
This section is necessary to distinguish between the Clone and run the tutorial app and Installing the SDK section. Right now it seems like in the tutorial app you have to install the sdk, but those instructions are for adding sdk into an existing application
Refer: https://docs.imagekit.io/getting-started/quickstart-guides/ios#setup-imagekit-ios-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the heading to separate the sections.
| * Aspect Ratio | ||
| * Chained transformation | ||
|
|
||
| ImageKit Android SDK provides a function to each transformation parameter e.g. `height` for `h` and `width` for `w` parameter. It makes your code more readable. See the [full list of supported transformations](https://github.com/imagekit-developer/imagekit-Android#list-of-supported-transformations) in Android SDK on Github. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ImageKit Android SDK provides a function to each transformation parameter e.g. `height` for `h` and `width` for `w` parameter. It makes your code more readable. See the [full list of supported transformations](https://github.com/imagekit-developer/imagekit-Android#list-of-supported-transformations) in Android SDK on Github. | |
| ImageKit Android SDK provides a function to each transformation parameter e.g. `height` for `h` and `width` for `w` parameter. It makes your code more readable. See the [full list of supported transformations](https://github.com/imagekit-developer/imagekit-android#list-of-supported-transformations) in Android SDK on Github. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| Let's learn how to upload an image to our media library. | ||
|
|
||
| Android SDK provides `ImageKitUploader` which provide functions to allow upload files to the [ImageKit media library](../../media-library/overview/) directly from the client-side.  |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Android SDK provides `ImageKitUploader` which provide functions to allow upload files to the [ImageKit media library](../../media-library/overview/) directly from the client-side.  | |
| Android SDK provides `ImageKitUploader` which provide functions to allow upload files to the [ImageKit media library](../../media-library/overview/) directly from the client-side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| For this, we would need a dummy backend app to authenticate our upload request. API authentication for upload always happens on the backend for security reasons. | ||
|
|
||
| The tutorial repository comes with a sample backend server that we can use.  |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove from everywhere, not commenting in the entire page
| The tutorial repository comes with a sample backend server that we can use.  | |
| The tutorial repository comes with a sample backend server that we can use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| Android SDK provides `ImageKitUploader` which provide functions to allow upload files to the [ImageKit media library](../../media-library/overview/) directly from the client-side.  | ||
|
|
||
| For using upload functionality, we need to pass `publicKey` while [initializing the SDK](Android.md#setup-imagekit-Android-sdk), and pass the client-generated JSON Web Token (JWT) in the upload method, which the ImageKit.io server uses to authenticate and check that the upload request parameters have not been tampered with after the generation of the token. Refer this [guide](https://docs.imagekit.io/api-reference/upload-file-api/secure-client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) to create the token below on the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary but URL's are case sensitive, it's better to keep it consistent
| For using upload functionality, we need to pass `publicKey` while [initializing the SDK](Android.md#setup-imagekit-Android-sdk), and pass the client-generated JSON Web Token (JWT) in the upload method, which the ImageKit.io server uses to authenticate and check that the upload request parameters have not been tampered with after the generation of the token. Refer this [guide](https://docs.imagekit.io/api-reference/upload-file-api/secure-client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) to create the token below on the page. | |
| For using upload functionality, we need to pass `publicKey` while [initializing the SDK](android.md#setup-imagekit-Android-sdk), and pass the client-generated JSON Web Token (JWT) in the upload method, which the ImageKit.io server uses to authenticate and check that the upload request parameters have not been tampered with after the generation of the token. Refer this [guide](https://docs.imagekit.io/api-reference/upload-file-api/secure-client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) to create the token below on the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
b043074 to
33b807b
Compare