Inspiration

In 2012, the average attention span was 2.5 minutes. Now, it’s shrunk to about 47 seconds. How did this happen? Well studies have shown that screentime, especially mobile phone use, can significantly reduce not only attention spans, but also overall focus and cognitive load. Many focus apps try to solve this problem, but very few leverage physical presence and shared accountability. Introducing Study-Sphere; an iOS peer-to-peer peer-pressure study app!

What it does

StudySphere is an iOS productivity app where you can create a study sphere and via multipeer connectivity any nearby phones will be able to detect it and join. At this point, you are able to select apps that will be blocked for the duration of the sphere. The leader can also determine two modes competitive and casual studying, competitive infers that your phone cannot be moved and casual allows the phone to be moved within a certain radius to the leader phone. Once the leader starts the study sphere it is in effect until the leader chooses to close it. It also leverages large language models to generate custom messages whenever the user tries to access blocked apps.

How we built it

This was built completely in Swift, we used SwiftUI for the frontend and many of Apple's frameworks such as Multipeer Connectivity for the peer-to-peer connections, Metal for some UI components, Nearby Connections for finding phone positions between varying phones, CoreMotion for checking if a phone is still or moving. We managed all of these using the VISOR architecture developed by our team member Anh, to successfully assemble all these different services together. We downloaded a custom LLM through hugging face and asked it to generate different types of roasts and stored this inside our app. Now this app cycles through different roasts whenever you access a blocked app.

Challenges we ran into

We ran into a few challenges during our project, one of our main challenges were the APIs we had to use having poor documentation. This made it hard for us to properly utilize the APIs properly as we had to do lots of trial and error, especially with the given time pressure. We also had some problems with buggy APIs. In a nutshell, the multipeer connectivity we used doesn’t allow us to check for available connections, it will only notify whether or not a peer is available. This meant that we had to store a set of the available people, but if by any chance the delegate callback is dropped, it would cause the set to be inconsistent.

Another challenge was that the multipeer framework needed phones to be on the same Wi-Fi or hotspot, however we were on Eduroam which unfortunately had problems due to some network issues. The main issue for this was figuring out it was an issue with the framework and not the code as it was extremely flaky when on Eduroam which could’ve been due to our code.

Accomplishments that we're proud of

It was rewarding learning how to use new frameworks and architecture for Swift in our project. A main one we used was the Visor framework, made by our own team member Anh. Overall, we feel that our proficiency at using Apple framework and Swift as a language has improved significantly.

What we learned

We explored a lot of apple’s SDKs and gained valuable knowledge in knowing how they work and the capabilities of them. We also learnt a lot about system design through the VISOR framework using good software practices. We all gained experience in working in a large-scale codebase where a majority of us were unfamiliar with software design.

What's next for StudySphere

Since we are planning on maintaining the project, a lot of features could be added to StudySphere. One feature we are looking forward to implementing is the ability for users to share and join sessions through a link, bypassing the need for close physical proximity to use multipeer connectivity. This would allow for remote study sessions. Additionally, we plan to implement a statistics tracking feature that shows data such as time spent studying and overall consistency, offering users valuable insights into their study habits.

Built With

Share this project:

Updates