how can I get image asset(from online or somewhere else) so that i can insert an image in my android app using android studio?
Asked
Active
Viewed 123 times
0
-
Also see https://stackoverflow.com/questions/27394016/how-does-one-use-glide-to-download-an-image-into-a-bitmap – Code-Apprentice May 22 '20 at 06:49
2 Answers
0
Using Image library is easy way. (like Glide, Picasso, etc.)
for example. (using Glide)
String imageUrl = "https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory&fname=https://k.kakaocdn.net/dn/EShJF/btquPLT192D/SRxSvXqcWjHRTju3kHcOQK/img.png";
Glide.with(this).load(imageUrl).into(ivImage);
it make image from url.
Plus. how you can use Glide
Add the dependencies in build.gradle(app)
dependencies { implementation 'com.github.bumptech.glide:glide:4.9.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' }
and use it.
more info is here

S T
- 1,068
- 2
- 8
- 16
-
But I don't have any knowledge about Glide, Picasso,etc. Is there any other way to do it? – Arijit Paul May 22 '20 at 06:49
-
@ArijitPaul, no other easier ways than loading images with libraries (eg. Glide, Picasso) – ZarNi Myo Sett Win May 22 '20 at 07:13
0
The best way to do would be to use third party image libraries like Glide, Picasso, etc.
Here is how you can easily do it using Glide
Add the dependencies in build.gradle(app)
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
Using Glide to fetch the images
ImageView targetImageView = (ImageView) findViewById(R.id.imageView);
String internetUrl = "http://i.imgur.com/DvpvklR.png";
Glide
.with(context)
.load(internetUrl)
.into(targetImageView);
You can refer to this tutorial for more

Sonu Sourav
- 2,926
- 2
- 12
- 25