Hi I am new for android and in my app I have to find the file size before downloading it.
For this I wrote the code below, but it's giving me content length 2588 but the actual size of my file is 745 MB.
Please help me. How can I find the exact file size in MB's?
code:-
URL url = new URL("mu url");
URLConnection urlConnection = url.openConnection();
urlConnection.connect();
int file_size = urlConnection.getContentLength();