Method for storing Android pictures to specified paths and albums

In ordinary projects, we may store some avatars and QR codes. This article mainly introduces the problems you will encounter in storage and some improvement schemes.

1. First, long press save: you can refer to the on the network, but you have to splice a file path first. Note: IO streams can only help create files, but cannot help create directories (paths).

2. Guide the specific file name and path:

3. File reading:

4. For pictures, we also want to store them in a fixed path and view them in an album. This is to use a radio to tell the album that there are picture updates.

Through the above steps: we can view the stored pictures in the folder and album of the specified path.

The effect is as follows:

5. In addition, although toast prompts the user to store the path, it will not be found. In fact, when testing with a real machine (without SD card), the pictures are stored in the memory of the mobile phone = = "ememed = =" where the pictures are.

6. Store SD card. Such operations often require permissions. So don't forget to configure permissions in androidmanifest:

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>