Use SmartBand 2 sensor data for innovative Android and iOS applications

As an app developer, you can retrieve sensor data from SmartBand 2 using standard sets of APIs for Android and iOS platforms. Depending on the platform you are developing for, you can use Sony’s Lifelog API, Google Fit APIs or Apple’s HealthKit. You can then analyse and process the sensor data to provide useful insights and visualizations that can help your users live a healthier lifestyle.

SmartBand 2 is compatible with any smartphone running at least Android 4.4 or iOS 8.2, and it’s equipped with an accelerometer and a heart rate monitor. It tracks steps and activities like walking, running, and sleeping, while also monitoring heart rate (HR) and heart rate variability (HRV). This way, the SmartBand 2 will provide data allowing for biometric tracking and insights into overall fitness, excitement, stress and recovery levels throughout the day and night.

In the following sections you will find information about the different sets of APIs that can be used to collect sensor data from SmartBand, and how to get started.

Use Lifelog API to develop innovative fitness apps or services
The Lifelog app lets users track their lifestyle, fitness, and health through sensors in the smartphone and connected wearables like SmartBand 2. The Lifelog app uploads sensor data to the Lifelog platform data store, a cloud based repository. Your app can access this data using the Lifelog API, if your users agree to share it with your app.

The Lifelog API is a REST-based web-service API, from which you can get information through three different endpoints:

  • User profile, basic personal information such as name, age, height, and weight.
  • Activities, data such as “walk” and “sleep”.
  • Locations, coordinates that tracks where the user has been and how the user has moved.

SmartBand 2 provides the following Activities data types to the Lifelog platform data store:

  • physical (with the subtype walk)
  • sleep

The Lifelog web API uses OAuth2 authentication and all requests are made using the HTTPS protocol. The following example of an API call illustrates how to retrieve data for the activity data type “physical” and subtype “walk”:

The Lifelog API can be used for apps on any platform. To learn more and start using the Lifelog API, go to the Lifelog get started page.

Overview of the Lifelog API architecture. The Lifelog app populates the cloud based repository with logged data, and a third-party app or service uses the Lifelog API to access the logged data.

Overview of the Lifelog API architecture. The Lifelog app populates the cloud based repository with logged data, and a third-party app or service uses the Lifelog API to access the logged data.

Use Google Fit APIs to store and access fitness data from any wearable and sensor
Google Fit is an open ecosystem that allows developers to upload and store sensor data to a central cloud based repository. If your users grant you permission, you can access their data using the Google Fit APIs.

The Google Fit APIs consist of two sets of APIs:

  • Google Fit Android APIs included in Google Play services, for Android apps.
  • Google Fit REST API, for apps on any platform.

Both sets of the Google Fit APIs work with three types of data: Public data types, Custom data types, and Shareable data types. SmartBand 2 provides the following Public data types to the Google Fitness Store:

  • (steps)
  • google.heart_rate.bpm (heart rate in bpm)
  • google.activity.segment (sleeping, walking, running)

For the Google Fit Android APIs, steps, walking, running, sleeping, and heart-rate history are available in the History API, while real time heart rate is available in the Sensors API.

To retrieve, for example, the daily total steps you can pass the TYPE_STEP_COUNT_DELTA data type to the HistoryApi.readDailyTotal() method.

Using the Google Fit REST API, you first make an API call to get a list of available data sources (you might have several):

The data sources contain data sets which hold the activity data you are interested in, for instance where the data type is (steps) and the source is com.sonymobile.hostapp.everest (SmartBand 2). The API call for getting data sets is:


Property nameValueDescription
dataSourceIdstringThe format of the dataSourceId created by an Android application is:
datasetIdstringThe datasetId is formatted like “startTime-endTime”, where startTime and endTime are 64 bit integers.

Based on this, the call to retrieve step count data from For SmartBand 2 would look like this:

To learn more about Google Fit, and get started using the Google Fit APIs, visit the Gooogle Fit platform overview.

Use HealthKit to manage, use and share fitness data on devices running iOS
The HealthKit framework is designed to let apps use and share fitness data from a wide range of sources and sensors. All collected data are stored locally in the HealthKit store on the user’s device, and can be accessed using HealthKit, the accompanying API included in the iOS SDK. The users can edit the permissions to read, write, and share, for each app and each data type.

HealthKit data is divided into two main groups: characteristics and samples. Characteristics data includes for example the user’s birth date and blood type – data that typically does not change. The Samples data can be partitioned into four types: Category samples, Quantity samples, Correlations, and Workouts.

SmartBand 2 provides Quantity and Category samples to the HealthKit store, which can be identified by:

  • HKQuantityTypeIdentifierStepCount (steps)
  • HKQuantityTypeIdentifierHeartRate (heart rate)
  • HKCategoryTypeIdentifierSleepAnalysis (sleeping)

To query the HealthKit store for data, you call the initializer initWithSampleType:predicate:limit:sortDescriptors:resultsHandler:, and then run the query by calling the executeQuery: method.

Learn more about HealthKit by visiting The HealthKit Framework page.


Are you eager to start developing apps that utilize sensor data from SmartBand 2? Drop us a comment and let us know which set of APIs that best suits your objectives and why.

More information

Comments 7

Sort by: Newest | Oldest | Most popular

  1. By Clece Band


    Hello, I have the same problem, I haven’t been able to access the steps in real time, the only way I have found is through Google Fit History, but it would no longer be in real time, besides the connectivity of Google Fit Api through Google Fit Sensors Api by bluetooh with the SmartBand2 is defective.

  2. By Rei Kagetsuki


    I’m trying to implement an application that requires step delta or cadence from real time sensors through the Google Fit API. Is there any way to get real time step count from the SmartBand 2? I’m able to get BPM just fine, but really need step counts.

  3. By Bharat Bollampally


    Hi , How can i get the Raw accelerometer data using rest APIS from google fit

    • By Vidhi S


      Hi Bharat, were you able to obtain the Raw accelerometer data?

  4. By Jacky Kan


    How often does Lifelog uploads the data to the Lifelog Platform Data store? Cause I would like to know in real time what activity is the user doing etc!

  5. By Nico Teuschler


    Why is herat rate not avialable to read, is your HRV patented?

  6. By Sonny Johanssin



1-7 of 7 comments.