I am getting the file size in my android app which is on a remote machine by the following line:
long fileLengthOnServer = connection.getContentLength();
The problem is sometimes the value of fileLengthOnServer is a negative value. As I read in some posts a long variable should be initialized by a value with L at the end, but I dont know in my case how to add it. If I cast it to long solves the problem?
Thanks in advance