My app picks up the GPS location of the user every 5 minutes, saves it and then sends it to a server. The problem I'm facing is I need the data stored on the android SD card to be Crypted so no one except me on the server can access it. Also I need to think of a way to make sure that no-one has edited the data except me. For the last I've thought writing the MD5 checksum of the file each time I close it so when the app opens the file it checkes the MD5 to see if they match. The problem with this is I think it'll waste resources and battery as I'm already checking for the GPS location every 5 minutes. Any ideas would be appreciated as for crypting data I've been unable to find the most secure way Thanks!!!
EDIT: I've already checked subjects on cryptography but everything seems so think that it's vulnerable to anyone with a little time, that's why I'm asking!
You should store your data using Sqlite with SqlCipher: http://sqlcipher.net/sqlcipher-for-android/
As you say, there is no way to completely prevent the data from being viewed/edited by a determined attacker, as you will have to expose your encryption key either in the program code or a save file somewhere on the system.
However no homegrown solution you or I could write would be any better, this is just the nature of the hardware/OS.
If you want the data safe from reading, I suggest you delete it after transmitting to the server.
Aside, if you're checking GPS every 5 minutes, there is hardly anything you could do that would be a noticeable battery drain compared to that.