How To Get Started Developing Apps For the Key Wearable Platforms
The adoption of smartphones and tablets has grown exponentially and with it, people want to have these devices with them to complete everyday actions, whether reading the news or checking traffic conditions. But these devices are not always the most practical to use: recent research for example indicates 40% of consumers are “tired of pulling their phone out of their pocket”.
As a result the “wearables” market has grown from zero just a few years ago, to one forecast by the analyst company IDC to sell 45 million units in 2015, rising to 126 million by 2019. These devices make it possible to interact with services in an easy way (for example in the case of smart bands or smartwatches, simply by looking at our wrist).
This more personal and individual approach to wearable technological devices has tremendous potential in a variety of sectors: whether it’s tracking your vital signs and reporting the data back to hospitals or clinics; or solutions that can keep track of, and control, our home devices; or using voice recognition to help with our everyday tasks.
The goal of this post is to provide details about these devices and more specifically on smartwatches. The blog will introduce newcomers to the first steps, and pitfalls, you will find when developing wearable apps.
How To Get Started With Apple Watch
To get started with your first Apple Watch app all you need to have is the latest version of Xcode installed on your Mac. Even though Xcode 6.2 has the watchKit SDK, with Xcode 7 and watchOS 2, significant enhances were introduced to better serve Apple Watch apps; therefore, we recommend version 7 of Xcode. Plus, this release includes the Xcode IDE, Swift 2 compiler, Instruments, simulators and latest SDKs for OS X, iOS, and watchOS 2.
Apple Watch consists of two separate bundles: a Watch app and a WatchKit extension. As the watchOS developer library states: The Watch app contains the storyboards and resource files associated with all of your app’s user interfaces. The WatchKit extension contains the code for managing those interfaces and for responding to user interactions. Both bundles are delivered as part of your iOS app, but the configuration and installation of those bundles is different in watchOS 1 and watchOS 2. In watchOS 2, both bundles are installed on the user’s Apple Watch and run locally. In watchOS 1, the Watch app runs on the user’s Apple Watch, but the WatchKit extension runs on the user’s iPhone.
It’s also important to recall the fact that even though with watchOS 2 apps can run natively and more independently from the iPhone, its dependency is still very strong; hence, an iPhone app is always required for Apple AppStore approval.
First, you need to install Xcode from Mac AppStore or from the developer’s website at https://developer.apple.com/xcode/download/. You must have an existing iOS app to create a WatchKit app. The WatchKit app is implemented as a separate target of your Xcode project and is built and packaged inside your iOS app’s bundle.
To add a WatchKit app target to your existing iOS app project:
- In Xcode, open the project for your iOS app.
- Select File > New > Target, and navigate to the Apple Watch section.
- Select WatchKit App, then click Next.
- If you plan to implement a glance or custom notification interface, select the appropriate checkboxes.
- For notification interfaces, it is recommended that you select the Include Notification Scene checkbox, even if you do not plan on implementing that interface right away. Selecting that checkbox adds an additional file to your project for debugging your notification interfaces. If you do not select that option, later you must create the file manually.
- Click Finish.
Xcode configures the targets for your WatchKit app and WatchKit extension and adds the needed files to your iOS project. The bundle IDs for both new targets are configured automatically, based on the bundle ID of your iOS app. The base IDs for all three bundles must match; if you change your iOS app’s bundle ID, you must update the other bundle IDs accordingly.
Capabilities For Developers
Developers are able to do more as Apple releases better versions of watchOS. As of watchOS 2, these are some of the things developers are able to control and, therefore, use on their Apple Watch apps:
How To Get Started Android Wear
With the arrival of Android Wear we have a lot of new ways to expand our already existing handheld apps. Android Wear not only brings their own API, but also has design guideline principles to take into consideration, to help ensure the best experience for your users. We’ll share what you need to start and what are the main features that you can take advantage of.
To get started you will need to have installed Android Studio and update the Android SDK tools to version 23.0.0 or higher and the SDK with Android 4.4W.2 (API 20) or higher that contains the needed components to start developing Android Wearable Apps. If you are not familiar with Android development you can get started in the official android developer guide.
Now that everything is up to date, you can continue creating your Android Wear virtual device from Android Studio, following these steps:
- Open the AVD Manager (Tools / Android / AVD Manager)
- Click Create Virtual Device.
- Click Wear category.
- Select a round or square Android Wear Hardware Profile.
- Click Next.
- Select your target Android version, eg. Lollipop
- Click Next.
- Verify the configuration from your Android wear and modify it if suits for you.
- Click Finish.
- Select the just created d
- Device and click Start.
- The emulator will initialize and display the Android Wear home screen.
Once we have the emulator, it’s time to pair it with your Android mobile device with these simple steps:
- Download the Android Wear Application from the PlayStore.
- Connect your mobile device through USB
- Head to the folder where your SDK is located (you can find this location on the SDK manager) and enter to the tools-platform folder. If you are on Windows Explorer press Shift + Click the right click and select Open command windows here. Once in the command line copy this line:
adb –d forward tcp:5601 tcp:5601
Remember you will have to do this every time you want to connect an emulator with the handheld device
- Start the Android Wear Application and go to settings and select the connect emulator option
- After the connection is successful you can try some features like Notifications in Settings \ Try out watch notifications.
That’s it, you’re done and ready to start playing around and get familiar with the Android Wear SDK. You can find lots of tutorials on the internet, however we highly recommend following the training sessions from the official Android Developers site.
It is clear we are at the very beginning of the wearable journey. There are many opportunities for wearables beyond the current use of sensors to track your bodily signals, and many use cases are at the early stages of development.
Talking about Apple Watch and Android Wear side by side can be challenging. Although each of these platforms have similar hardware, their functionality and purpose differ significantly, at least according to each company. Apple’s vision, for example, is that every Apple Watch app should extend from an existing iPhone app and it should serve its purpose in just 10-15 seconds; whereas Android Wear provides developers with much more freedom to experiment.
What we, as developers, should do is understand the differences, advantages and disadvantages of each platform, so we can build powerful, relevant solutions to delight our users.