I need to do the following: - Take a text file. - Read the first word of each line and count each kind using a hashmap. - Make the result reach a server.
My question is, what do you think is more battery efficient?
Parsing the file on the Android device and sending the resulting hashmap to the server.
Sending the complete file to the server (compressing with gzip) and doing the parsing online. The retrieving the result to the phone again.
** file sizes can go from 100kB to 5MB
I have already implemented option A, which works well: parsing is done within milliseconds even for big files.
Sending the results, which is just a list of 200 integers, takes slightly longer.