< Blogs
Elliott

Elliott

June 30, 2022

How-tos: Using SDKs

Everything given in one kit

It would be an absolute nightmare if you ever tried building one of those IKEA tables without one of those hexagon keys or hexagon screwdrivers.. you know which ones I'm talking about. These things are part of a Tool Kit and they are really useful because they let you nail something, screw something, or twist something way easier (and more secure) than if you tried with your bare hands or a makeshift hammer with a branch.

Similarly, Software Development Kits (SDKs) do the same for developers! They abstract things into easy-to-use tools so you do not have to implement them completely from scratch.

Definition

SDKs are generally made in a way that would have a specific use case for a specific platform. However they usually all have some things in common.

SDKs would generally contain tools such as:

  • Compiler - This allows you to work in the programming language you want
  • Debugger - Helps you find bugs in your code as you implement new functionality
  • API - An interface that allows your application to interact with others
  • Documentation - A whole bunch of text telling you how to use the SDK
  • Testing Tools - Tools to let you test your application
  • Code Samples - Some code showing you examples of how to use the SDK

The Power of SDKs

There are so many SDKs out there that allow you to do much neat stuff. Terra provides a few SDKs for easy connections to different Health Data providers such as Apple, Samsung, and Google Fit.

Of course, every SDK would come with its own installation instructions. It is always crucial to follow them step by step to make sure the installation is done properly. At Terra, we try to make everything as simple as possible for developers. Our Android SDKs are a one line instalment in your gradle file.

Let us test out the TerraAndroid SDK to send Google Fit Activity data to your webhook through Terra (You can sign up here). Through Android Studio (which actually lets you use the Android SDKs to help you build, develop, compile, debug, and test Android Apps!), installation is done in one line inside your build.gradle file under your app:

implementation 'co.tryterra:terra-android:1.0.4'

Running this, and syncing your gradle files, allows you to access every exported function, classes, constants, enums, etc contained within the SDK.

We can start development with it now:

Instantiating the Terra class now, you may initiate a connection to any of the integrations allowed in the SDK.

Let us do a Google Fit SDK connection. Following TerraAndroid SDK instructions, I have created a project on Google Developer Console, set up the OAuth consent screen with the scopes required by the SDK, and created a new Android App OAuth Client.

Doing this now, I can go back on Android studio and get my Activity data for today from Google Fit in a couple function calls:

Running this function would trigger the SDK to prompt for permissions, grab the data and send this data to your backend:

Now you may compare this to you having to deal with the Permission handling, getting data per each data point from Google (Heart rate, steps, calories, distance, etc), filtering the activity segments, and parsing the response into a coherent model. You might then want it sent to your backend as well. All of this was abstracted away from you by the SDK and you simply have to run the one function to get the Activity Data.

Develop at 10x speed

The example above is just a very simple and general use case of a type of SDK. As mentioned before, an SDK can contain a lot more and can be a lot more broad, such as the Android SDK. However, the idea is that they are there to simplify your code (and your life), and save you hours on implementing something that is already done.

Search on Google to see if the tool you need exist, install it and start building your app! If there are no such tools, then of course... starting from first principles is always a good start ;)

More Topics

All Blogs
Team Spotlight
Startup Spotlight
How To
Blog
Podcast
Product Updates
Wearables
See All >
CEO and Co-Founder of Bioniq - Vadim Fedotov

CEO and Co-Founder of Bioniq - Vadim Fedotov

In this podcast with Kyriakos the CEO of Terra, Vadim Fedotov a former professional athlete turned entrepreneur, shares his journey in founding Bioniq.

Terra APITerra API
December 10, 2024
5 Lessons for Standing Out at HLTH

5 Lessons for Standing Out at HLTH

5 lessons from team Terra API for making a lasting impact at HLTH: from engaging senses to building real touch points, here’s what we learned from the HLTH event.

VanessaVanessa
December 5, 2024
November '24 Updates by Terra

November '24 Updates by Terra

Terra’s Latest Updates: Zepp Metrics, Support Revamp, and Teams API Enhancements 🚀✨

Alex VenetidisAlex Venetidis
December 1, 2024
Strava Pulls the Plug on their API: What This Means for Developers

Strava Pulls the Plug on their API: What This Means for Developers

Strava discontinued their API service, changing the ecosystem of third-party apps that have relied on their platform. How can developers react to this?

Terra APITerra API
November 21, 2024
Alternatives to the latest changes in the Strava API

Alternatives to the latest changes in the Strava API

Strava just introduced big changes to their API program. These changes will basically kill off a lot of apps. Use Terra API instead to avoid this

Kyriakos EleftheriouKyriakos Eleftheriou
November 19, 2024
next ventures
pioneer fund
samsung next
y combinator
general catalyst

Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.