View Single Post
  #23   Spotlight this post!  
Unread 04-03-2014, 14:55
lbertoncin's Avatar
lbertoncin lbertoncin is offline
Registered User
AKA: Louie Bertoncin
FRC #1730 (Team Driven)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2009
Location: United States
Posts: 36
lbertoncin is just really nicelbertoncin is just really nicelbertoncin is just really nicelbertoncin is just really nice
Re: "FRC SCOUT" is OUT

Quote:
Originally Posted by nathanwalters View Post
Looking good! It's simple, functional, and pretty straightwforward. I'm building a scouting app for my team this year and I'm wondering how you're handling syncing data between tablets. What format are you sending the data in, how do you determine which data to send each time (is it all the data or just data changed since the last sync), and how do you handle conflicts upon sync (for example, two users pit scout the same team and then try to sync with each other)? Again, very nice work!
On the "Scoring" page where the scouts do the main portion of the scouting, I use the API called Multipeer Connectivity (new to iOS 7), activated by tapping the button on the top left titled "Insta-Share". After Insta-Share has been activated, every time a scout saves a match, they send that match bundled up in an NSDictionary inside an NSData object to every connected Peer. On this page, I overwrite any conflicting stored data with the data coming in. No exceptions. The overwrite only happens if the team scouted is from the same regional and the same match number. The sharing on this page is on a match by match basis and allows for a quick transfer without disrupting the user's experience.

On the "More" page there is a much larger sharing capability where I use the file transfer feature of Multipeer Connectivity. I have the sending iPad store all its data to a local filepath, send the data to the receiver (who also stores it in a local filepath), and display the progress on the progress bar as it happens. After the transfer is complete and the receiving iPad stored the data into its Core Data model, both iPads delete the local url that they created for the transfer so that they no longer take up any extra memory from the transfer.

In your example of two users pit scouting the same team, the receiving user has the option to allow overwriting for any conflicts. There is a switch that appears with the other User Interface elements once a connection is established on the "More" page that, when the switch is on, overwrites all conflicting data with the incoming data. If the switch is off (which is default), the conflicting incoming data is thrown away after the transfer is complete and the receiver keeps the data they had before.