I use internal data (the app's private data) to save data.
However, in the event that the device is out of storage, how can I check if the storage is full before saving? And in the event the data written to the file is very big, causing the device's storage to become full, how can I check this and notify the user/prevent the app from showing the force close dialog?
Does the Android system do anything on this issue(e.g. show a message that tells the user there isn't more space on the device)?
The main concern is making sure the check happens on the applicable drive; if the app has been moved to an SD card or some other external storage unit, that is the drive that should be checked against in terms of remaining memory
Example scenario: The device has 238KB left. There are 10 files that data is saved to. Each file is 30-40KB. Assuming the average is 35KB/file, 6 files can be written, while the last 4 cannot. How can I handle issues such as this?