The third way to store data in an Android system is external Storage, which is external storage.
External storage is typically stored in public data and is stored on an expansion card or SD card.
External storage is not required, and data stored on the expansion card is not secure because all programs can access data on the expansion card and read and write data.
1. Use external storage to add the appropriate select, such as read_external_storage or write_exteranl_storage
eg
2. It is important to determine if the expansion card is mounted, because the expansion card is not required for Android and is external.
An example of a judgment you write yourself:
Examples of Official document judgments:
Here:getexternalstoragestate () returns a string constant that describes the status of the expansion card.
3. Determine if the expansion card space is sufficient (optional)
4. Save the image to the expansion card (optional)
5. Save the image to the expansion card (optional)
6. Read the picture from the expansion card (optional)
7. Empty the expansion card
8. Get the name of the file
Note: In order for the file name to be unique, you can use the MD5 algorithm to match a name string to a unique string.
9. about the cache of external storage
Context.getexternalcachedir ()
10. Common methods for external storage
Getexternalstoragepublicdirectory ()
Getexternalfilesdir ()
Getexternalfilesdirs ()
Getexternalcachedirs ()
Not finished, to be continued.
Android data Storage (3): External Storage