-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base 64 Encoding Of Data #176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! Thanks for working through this on your own.
I don't think it's a good idea to merge this until we have all the code setup on the serverside as well to make sure both apps always work together on the same release and so we can test the code though.
Make sure to make a new branch without these commits if working on another feature at another time.
I also made some change suggestions.
Again, thanks for working this out on your own, obviously code style is a personal thing so it is hard to guess the style me and Greg like to use, but I still want to stick with one consistent style throughout the project.
Another thing to keep in mind is that we must make sure how this data is being used, because we also save "pending data" onto the phone as a string, so if this is now in base 64, we need to add the decoder when loading that back up.
Saves local files properly still, converting back to a normal string Converts the full data sent to base64 as well before sending.
Server-side done, but needs testing |
Bytes were being sent without being converted to a string, things weren't being encoded. Added a nice function to quickly convert to base 64.
Base 64 Encoding Of Data
This uses the android.util.Base64 method of encoding to base 64, and will modify the data before it is saved/sent.
The server-side portion of this can easily be implemented by taking the portion where the server loads the file and decoding it, using this method: