K
K
Konstantin Lipatov2018-08-30 19:01:22
Android
Konstantin Lipatov, 2018-08-30 19:01:22

How to implement downloading a picture on the phone in Android Studio?

I have several pictures that are stored in the application's resources, how can I download these pictures to the phone's memory?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-08-30
@Weys

What about Android Studio?
This is done as follows: get the application context, get the InputStream by resource id, copy the bytes from the received InputStream to the OutputStream of the newly created file where you want to save the picture.
Well, do not forget to specify in the application manifest permission to access files on the SD card and internal memory of the device. Before the copy process, you ask the user for your application's access to this permission.
Or do you need a ready-made snippet?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question