Saving Image Files Inside the Android App

Asked 2 years ago, Updated 2 years ago, 25 views

I'm making a simple app.

I take pictures from the gallery and include them in my app.

I need to save this picture, where should I save it?

The db file is automatically saved in the app, but I don't know how to use the picture

I don't think it's like creating a folder in an external memory and storing pictures.

I'm trying to save it in the app like db (using getFilesDir()), but I don't know if this is right.

Also, I wonder if it is okay to have more pictures

I wonder how you usually handle it.

Thank you^

^

android

2022-09-22 18:30

1 Answers

If you use the data inside the app, you can use getFilesDir() or getCacheDir() as you said. This is often the case when implementing image cache. It is natural that the app data size increases as there are more photos, but it is necessary to devise and implement a storage strategy depending on what purpose the image should be stored.

For example, if the original file size is too large, reduce the capacity by resizing the image properly, or if the number of stored images reaches a certain level, erase the existing cache and cache the new image.


2022-09-22 18:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.