I calculate the size of the folder in my application using "file.length ()". It works fine in other versions of Android OS and I get my folder size in bytes. But the problem is that when I run the same code for a device that has Gingerbread, it always shows me the size as 0 bytes. I can not understand the problem. Here is my code: -
File file1=new File(android.os.Environment.getExternalStorageDirectory(),"/.Gallery"); double total_length = file1.length();
Please help me solve this problem, any help will be noticeable.
Thanks in advance.
source share