Skip to content
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

Merged
merged 7 commits into from
Jan 25, 2019
Merged

Base 64 Encoding Of Data #176

merged 7 commits into from
Jan 25, 2019

Conversation

AlAtEX
Copy link
Collaborator

@AlAtEX AlAtEX commented Jan 19, 2019

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:

byte[] data = Base64.decode(encoded_data, Base64.DEFAULT);
String text = new String(data, Charset.forName("UTF-8"));

Copy link
Member

@ajayyy ajayyy left a 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.

@ajayyy ajayyy changed the title Finished the Client-Side part of the Base 64 Encoding Base 64 Encoding Of Data Jan 19, 2019
Saves local files properly still, converting back to a normal string
Converts the full data sent to base64 as well before sending.
@ajayyy ajayyy added the blocked label Jan 19, 2019
@ajayyy
Copy link
Member

ajayyy commented Jan 23, 2019

Server-side done, but needs testing

@ajayyy
Copy link
Member

ajayyy commented Jan 23, 2019

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.
@ajayyy
Copy link
Member

ajayyy commented Jan 25, 2019

@ajayyy ajayyy merged commit 943b53d into LakeEffectRobotics:master Jan 25, 2019
ajayyy pushed a commit to ajayyy/LakeEffectScoutingApp that referenced this pull request Feb 26, 2019
ajayyy added a commit to ajayyy/LakeEffectScoutingApp that referenced this pull request Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants