I am unable to get the size of the image. Below is my code.
File root = android.os.Environment.getExternalStorageDirectory();
File dirM = new File(root.getAbsolutePath()+"/Download/images.jpeg");
Long length = dirM.length();
I am unable to get the size of the image. Below is my code.
File root = android.os.Environment.getExternalStorageDirectory();
File dirM = new File(root.getAbsolutePath()+"/Download/images.jpeg");
Long length = dirM.length();
You are actually fetching the length, not the size of the particular file. Use the below example to achieve what you want.
long imgSize = yourImageFileName.getAbsoluteFile().getTotalSpace();