Scheduling Visual and Base 64 encoding | Android Development

in utopian-io •  6 years ago  (edited)

Repository

https://github.com/LakeEffectRobotics/LakeEffectScoutingServerApp
https://github.com/LakeEffectRobotics/LakeEffectScoutingApp

What is this

This is a scouting app developed for FIRST Robotics Team 2708. It is used to scout other robots at the competition. The data is sent from 6 client apps to the server over bluetooth throughout the course of the events. The server must manage and put everything together

Scheduling Visualizer

I made a visualizer to show the who is scouting which robot and when. This a feature I added a few months ago that assigned a schedule to when people are scouting to give people breaks and create a shift system. Only 6 people need to be scouting at a time.

image.png

Base 64 encoding

This is a very important update. The app now converts everything sent over bluetooth to base 64 before sending. This is done to compress the data a little and make everything use as little characters as possible. This prevents any code "injection" from the user which was happening accidentally before (users putting colons or quotation marks messing with the parsers).

This also makes data loss a lot harder, as the base 64 decoder knows when data is invalid when it is missing part of the message.

This was done using Java's built in function Base64.encode() which converts the String or byte[] to a byte[] with an encoded message. This then is sent over bluetooth and decoded on that side.

image.png

Fixed end splitter issues

There were issues where it was not checking for the end splitter in the received data. The end splitter is used in case the data gets cut off by bluetooth and sent in mutliple packets (which does happen often with large amounts of data being transferred). This should hopefully fix issues with large data transfers.

Support more scouters

The scheduling system now works with more than 12 people, that is 2 shifts. Before, when there were 2 shifts, it would sometimes shift people on for only one match, then shift them immediately off. This does not make any sense, so instead it now gives the extra person extra time off.

Commits

https://github.com/LakeEffectRobotics/LakeEffectScoutingServerApp/pull/23
https://github.com/LakeEffectRobotics/LakeEffectScoutingServerApp/pull/22
https://github.com/LakeEffectRobotics/LakeEffectScoutingApp/pull/186
https://github.com/LakeEffectRobotics/LakeEffectScoutingApp/pull/185
https://github.com/LakeEffectRobotics/LakeEffectScoutingApp/pull/176

GitHub Account

https://github.com/ajayyy

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for your contribution. It's indeed a good update to prevent code injection, I am just curious if users put colons, will the encoding fail? The code looks great as always.

The text below "New Features" was not needed but you should take that as an example and then write your posts according to that. Though I really like the way you explained.


If you would like further explanation of the given score, please ask.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Right now (even before this update), it will not break with colons. However, sometimes, when I added new data to be sent I would forget to remove the colons from it before sending it, breaking the code. This should not happen anymore as everything is in base 64 from the beginning.

Sorry, I forgot to delete the "New Features" section :)

Thanks for the review!

Thank you for your review, @codingdefined! Keep up the good work!

Hi @ajayyy!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @ajayyy!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!