Home / News / Build An Apple Watch App In A Single Afternoon With playPORTAL
Build An Apple Watch App In A Single Afternoon With playPORTAL

Build An Apple Watch App In A Single Afternoon With playPORTAL

AirTime App Code Released 

Almost five years ago Apple launched the Apple Watch and now Apple dominates the smart-watch industry. Like the hand-me down trend that ignited the kid’s tablet market, Apple Watch is poised to be the next big trend for connected play.

To spur the industry to start developing Apple Watch apps for all ages, Dynepic has created and open-sourced a playPORTAL + Apple Watch app called AirTime. The AirTime app code provides companies an easy to understand example of how they can quickly create a kid-safe, social and competitive Apple Watch app for their brand.  

What previously took months, if not years, you can now do in an afternoon with playPORTAL Studio. There are no servers to spin up and you can leverage the playPORTAL kid-safe, all ages network for user login and social interaction in the app. Of course, building with playPORTAL Studio also gives you instant COPPA compliance for your app too.

Meet the AirTime App

The AirTime Pogo App enables simple gesture recognition to count pogo stick jumps and air time from the user’s wrist. Using playPORTAL’s Swift SDK, we’ve created a mobile application that leverages the Apple Watch and its onboard sensors to deliver an amazing connected play experience to the end-user.

The Apple Watch is worn on the jumper’s wrist and with the app open on the watch it can record all the players stats. It then transfers and displays the user’s stats while pogo-ing to its paired iPhone app. Users of all ages login to AirTime app using playPORTAL’s password free social-sign-on (SSO) so they can compete with their friends and even have their scores recorded and displayed on a global leaderboard.

Gesture Recognition Algorithm Development

To count pogo jumps, we utilize the motion sensors on the Apple Watch. When most folks think about creating a connected toy or sporting goods equipment, they want to put the electronic “brain” (sensors and radio) on the device itself. Many times though, you can rely on the motion data from just the wrist. The sensors on the Apple Watch and the sensor fusion features of Apple’s CoreMotion make developing gesture recognition apps relatively easy.  

To develop a motion tracking algorithm for AirTime that counts jumps, we first had to learn what the sensors saw as a “pogo jump.” To do this, we captured the 3-axis accelerometer sensor data from the Apple Watch using an app called SensorLog (another option is PowerSense). We started logging the sensor data with the SensorLog app running and it recorded the Apple Watch sensor data while we Pogo’d. We saved it to files that we then viewed in Excel. 

Looking at the different sensor output, we developed a quick algorithm that worked pretty well at capturing each pogo jump. To show off the most basic algorithm, we just used the accelerometer on-board for gesture recognition but you can make a much more robust algorithm using the full 9-dof output of the Apple Watch and the derived sensor fusion features available in Apple's CoreMotion.

Get Started on playPORTAL Studio

To get started, create a  playPORTAL Studio account and request early access account activation. Just send us a note to introduce yourself and we will get you instant access. Here are some of the playPORTAL Studio features you need to know to get Airtime working.

Apps – Here is where you will register the AirTime app for sandbox development. You will link your app to the playPORTAL Secure Cloud by generating the necessary API keys (make sure they are kept secret and never committed to a GitHub repo). Then you can add the specific playPORTAL SDK features (scopes) needed. All these features are free under a Starter Tier account. The Airtime app demos many of the available features.

Sandbox - Test your app in a sandbox “test” environment by creating fictitious users with different profile types: kid, adult, parent. You can even set up elaborate friendships between users to simulate real-life social network relationships, as shown in the screen capture below. Note: Sandbox users will work with the AirTime sandbox app you registered while the app is in development. Once your app moves to production for release on the app store, it is linked to the live playPORTAL family network and real use. 

Okay so you know your way around playPORTAL Studio, let’s get AirTime up and running and take a look at how it works.

Build the AirTime App On Your Machine

Getting AirTime running on your machine is simple and easy, luckily we have created a README outlining exactly how to do that.

Readme

These step by step instructions will take you through key steps like cloning the code to your machine and installing CocoaPods which are a dependency manager for Swift and Objective-C Cocoa projects that is required to run AirTime.

It will walk you through linking your AirTime app to the playPORTAL Secure Cloud. Following the README will get you up and running in no time. Once your app builds to your Apple Watch, you can test it on a pogo stick and report your highest scores to the leaderboard. Don’t have a pogo? Head on over to Flybar and get yourself one.

Tailor The AirTime Code For Your App

Want to create an app of your own? The AirTime source code and even the design files are available for you to build from to bring your ideas to life. 

Need ideas? Want to be the coolest Baseball coach - create an app to analyze your baseball team’s swing data and let players store their swing and compare with their teammates. Or perhaps turn the Apple Watch into a game controller for your mobile game. Or how about a jump rope counting app that allows users of all ages to compete for total unbroken jump rope scores on the leaderboard? You could even sell a jump rope to go with your app. As you can see the ideas for the Apple watch are really endless and quite exciting for kids to get up and moving. We can’t wait to see how you change the algorithm to bring your idea to reality!

The AirTime demo should provide enough code to get you started and should make your attempt at Apple Watch development using playPORTAL fairly simple, easy and fun. There are other demo apps and frameworks available on the playPORTAL Studio GitHub.

Now what are you waiting for? Let’s start developing! Feel free to contact us at support@playportal.io for any questions or assistance getting started.

Tips and Tricks

Want to give developing your own Apple Watch app a try? Here are some quick tips to help you get started:

  • When developing an Apple Watch app, remember that the goal is not to just create a replica of the mobile app version.
  • Minimalism is key! The best watch apps shine and stand out from the competition because they are simple and clean.
  • Turn to Apple! Apple has terrific documentation on user interface design that we recommend you take a look at before diving in! 
  • Keep it short & sweet! Apple’s Guidelines hint at user interaction with the device like the Apple Watch should take 30 seconds or less. Isn’t that crazy. 

Other Example Code

If you are interested in an Android App with playPORTAL Android SDK integration, take a look at Profiq’s blog. They provide detailed steps on how to build an app that allows users to create and share notes with friends.


For help, give us a shout at support@playportal.io.

0 comments

Leave a comment