if I use openFileOutput() to create and write to a temp file how do I get filesize after I\'m done writing to it?
Try to use below code:
// Get file from file name
final String dirPath = f.getAbsolutePath();
String fileName = url.substring(url.lastIndexOf('/') + 1);
File file = new File(dirPath + "/" + fileName);
// Get length of file in bytes
long fileSizeInBytes = file.length();
// Convert the bytes to Kilobytes (1 KB = 1024 Bytes)
long fileSizeInKB = fileSizeInBytes / 1024;
// Convert the KB to MegaBytes (1 MB = 1024 KBytes)
long fileSizeInMB = fileSizeInKB / 1024;
if (fileSizeInMB > 27) {
...
}
Hope It will work for you..!!