I made an app that, when executed, checks if there is an apk update, by comparing modified dates of the local apk vs the web apk (below is the code). Everything works perfectly.
However, when I go to "Data usage" in the phone, it tells me it used 104MB in the last 3 days, and I opened the app a few times only. It's the first app in the list, even worse than my browser. How could this be?? What is consuming so much data? How can I debug this?
BTW, my phone does not have a chip. I use it as a wifi only device.
This is the code I use to get the modification date:
public static long getfiledate(String url) {
long size = 0;
HttpURLConnection c = null;
try {
c = (HttpURLConnection) (new URL(url)).openConnection();
c.setConnectTimeout(timeout);
c.setReadTimeout(timeout);
if (c.getResponseCode() == 200) size = c.getLastModified();
c.disconnect();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (SocketTimeoutException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return size;
}
UPDATE:
1) 95% of the data usage it is marked as Foreground
.
2) I just opened and closed my app, and it 'consumed' 1.5MB!