< 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 >
Founder of Don’t Die - Bryan Johnson

Founder of Don’t Die - Bryan Johnson

In this podcast, Bryan Johnson shares his personal story of how he began his journey to becoming the the world's most measured human.

Terra APITerra API
October 25, 2024
CEO and Co-Founder of Veri - Anttoni Aniebonam

CEO and Co-Founder of Veri - Anttoni Aniebonam

In this podcast with Kyriakos the CEO of Terra, Anttoni Aniebonam shares his journey founding Veri, and his decision in the acquisition by Oura to further his vision.

Terra APITerra API
September 27, 2024
CEO and Founder of Prenuvo - Andrew Lacy

CEO and Founder of Prenuvo - Andrew Lacy

In this podcast with Kyriakos the CEO of Terra, Andrew Lacy shares his journey with Prenuvo which began from a personal health crisis.

Terra APITerra API
August 28, 2024
MedHacks: Using Wearables To Predict Heart Attacks

MedHacks: Using Wearables To Predict Heart Attacks

A few weeks ago we met Vishal, a recent engineering graduate who wanted to use Terra API as part of his MedHacks hackathon project, Cardio Clarity.

Gursukh SembiGursukh Sembi
August 19, 2024
Chief Digital Product Officer of Les Mills - Amber Taylor

Chief Digital Product Officer of Les Mills - Amber Taylor

In this podcast with Kyriakos the CEO of Terra, Amber Taylor shares her journey from childhood running to her leadership role at Nike and navigating cultural differences.

Terra APITerra API
August 2, 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.