Hello steemian, this time i want to discuss one of the popular android library for downloading and catching named glide,I like this library, it’s fast and efficient open source media management and image loading framework for android.
If you create android apps, of course there will always be the possibility of using images in app content, so in my opinion this will be useful for you
How to use it ?
Integrating Glide in your project is very easy. First add the glide dependency to your build.gradle.
dependencies {
// glide
compile 'com.github.bumptech.glide:glide:3.7.0'
}
Previously I have prepared the image to be used, the image url to be used is
'codedojo.asia/images/tutorial_glide/borobudur.jpg'
by the way do you know the contents of the image that i use in this example? it is a picture of borobudur, a 9th-century Mahayana Buddhist temple in Magelang, Central Java, Indonesia, and the world's largest Buddhist temple.
Ok, back to tutorial, In this occasion i will guide you to use it in android studio project
First creating new project
a. Give the application name TutorialGlide (or whatever name you want)
b. Select minimum SDK 16 or more
the following is a guide to the example of a glide implementation
Step 1 . Create application name(in application name must begin with a capital letter)
Step 2 Choose minimum SDK
In determining the sdk used we must see from the number of users as well as the minimum sdk version of the version of libary glide that we use.
Step 3 Choose Empty Activity
Android studio already provides some main template that we can use, like drawer, map, admob etc, but for now we only use Empty activity.
Step 4 set name main activity and main layout then wait until the process finish.
Add gradle for glide into app/build.gradle, after we added it dont forget to klik sync now on the top right of the screen
Add internet permission in manifest, of course this permission is required because we take pictures from the server, if the image you want to use is taken from the drawable folder, this permission is not required
Adding view in layout to show image, do not forget to add id to imageView, because id is needed when we initialize ImageView in MainActivity so that glide can recognize which view will be given image
Write some code for initialize ImageView and loading image from url into imageView in Main Activity
Now we can run this application on mobile or in emulator, do not forget internet connection because picture we take from server,
result of screenshot in my handphone
if you want to change the image to a size of 200px wide and 200px height and crop it in the center you can use this script :
output after using resize script ini glide
Conclusion
For the needs of the image process using glide is very easy, even google recommends the use of glide and use it in their internal project. besides using glide, for loading image we can also use other alternative that is picasso. if made a comparison between picasso and glide, each has advantages and disadvantages. For custom glides such as circular images, gallery creation and image content implementation using adapters we can discuss in the next post.
Posted on Utopian.io - Rewarding Open Source Contributors
Why are you using an outdated library version?
Get the 4.4.0 tutorial here: https://github.com/bumptech/glide
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks for the info :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks for your review
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @fahrulhidayat I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit