Currently I’m using the Java mail library at http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android to accomplish this; however I have to hardcode in the email and password to use.
I found another SO question regarding this and it linked to (Also one of the top Google results) http://nilvec.com/sending-email-without-user-interaction-in-android/ – but the site isn’t operating anymore, or is down currently.
I think the Javamail library works great right now, but I’d rather my code not be decompiled and have my User/Pass strings hanging out there; I know you can use ProGuard, but there’s still the risk of my information laying there for open eyes.
So my question here is: Is there another alternative that I have available as opposed to the Javamail library – and if not, how can I secure my data properly?
Thanks!
encrypt that information.
Your code can have a decipher to read that info.
You can store this as a private data of your app. and your app. can decipher the information when needed.
This is a better approach than just hard coding the password in your code as if you change your mail password for whatever reason you will have to rebuild and update your app to accommodate the change.
if it is encryped and stored you can always add the new password manually through a dialog since your application is the only app that can decipher the data.
Even if you don’t want to just update you can simply encrypt the new password and replace the encrypted file.
javax.crypto has a range of functions to help you with this.
http://developer.android.com/reference/javax/crypto/package-summary.html