This Code is not working for me.
long length = file.length();
length = length/1024;
Is there any another method to get size of file?
This Code is not working for me.
long length = file.length();
length = length/1024;
Is there any another method to get size of file?
File file =new File("//data/data/Your-Application-Package-Name/File/your-file-name"); double bytes = file.length(); double kilobytes = (bytes / 1024); double megabytes = (kilobytes / 1024);Log.d("file size","size of file in KB:"+kilobytes); Log.d("file size","size of file in MB:"+megabytes);