• Have Any Question?
  • contact@eitworld.com

External Storage

    • Android system provides the facility to store the data in the external memory such as SD-card.
    • Android device has the capability to add the external memory to store the data.
    • This memory can be removable such as SD-card and can be non-removable memory.
    • This is used when the internal memory of device is not sufficient to store the data then this memory is used.
    • When we save the data in external storage then system uses the mode MODE_WORLD_READABLE means we can connect our mobile to computer and modify the data stored in the external storage.
    • If we want to store the files in external storage then we have to use the following permissions as follows:
      • READ_EXTRENAL_STORAGE: this is used to read the files from the external storage.
      • WRITE_EXTERNAL_STORAGE: this is used to write or save the files on the external storage.
    • When we are working on external storage then first we have to check the status of media means it can happen that there is no file available in the external storage or can available only readable file.
    • To check the status of the media, we have to call the getExternalStorage() method. This method returns the state so that we can notify the user.
    • Public directories are used to make the file public. It is depend on us that we want to make the files public or not; if we want to make the file public then we can use this directory.
    • To save the files in external memory, we have to create the object of File and pass the file name, and pass the name of directory.
File myFile = newFile(DIRECTORY_PUBLIC, file_Name);
  • Files which are saved in the external storage can be used with internal storage files and methods can open it or edit it.

Real Time Web Analytics