1. Introduction

Asleep Track SDK is a software development kit that enables developers to create applications that monitor the sleep of users. The SDK provides tools and resources to integrate sleep-tracking features into mobile applications.

One of the primary features of the Asleep Track SDK is its ability to track the user's sleep in real time, including sleep stages and breathing stability. The SDK can gather information about the user's sleep patterns, including the amount of time spent in each stage of sleep. This information can be used to provide insights into the user's sleep quality and recommend improvements to their sleep habits.

Overall, Asleep Track SDK is a powerful tool for developers looking to create sleep-tracking applications. Asleep’s business partners only need to care about the UI/UX of their applications, and Asleep Track SDK will take care of all core functions for sleep monitoring.

With its advanced features and easy integration, it offers a comprehensive solution for developers looking to improve the sleep quality of their users.

2. Interfaces

2.1 Asleep.AsleepConfig

AsleepConfigcontains all the necessary configuration information, including the API key, user ID, and base URL for API communication. The configuration information of AsleepConfig is used throughout the sleep tracking features of the SDK.

2.2 Asleep.SleepTrackingManager

The SleepTrackingManager is used to manage sleep sessions for a specific user ID passed through AsleepConfig. This manager can start and stop tracking and recall the latest sleep reports from users.

2.3 Asleep.Reports

Reports is used to manage sleep reports of a specific user ID passed through AsleepConfig. This allows you to look up the IDs of all sleep session that occurred during a specific period of time, and to look up a detailed sleep report for each sleep sessionID.

2.4 Asleep.AsleepErrorCode

This document describes all available error codes to help developers understand what is happening inside the SDK.

3. Version History

v2.0.01. Change Reports Structure
v2.1.01. The noise reduction processing has been modified.
2. User-Agent has been added to HTTP.
v2.1.11. Ensuring Visibility of AsleepErrorCode Interface
2. Implementing ERR_NETWORK Listener for Handing Internet Coneection Issues
3. Changing HTTP Keep-Alive Time to 10 Seconds
v2.1.21. Redefine errorCode
2. Add related to TrackingStatus
3. Add defensive logic to close the session when initAsleepConfig is called during SleepTracking
v2.2.01. Add Developer Mode Function
2. Add Error Codes related to audio processing
3. Add Session Object parameter in Reports
- createdTimezone, unexpectedEndTime, sleepCycle, sleepCycleCount, wasoCount, longestWaso, unstableBreathCount, lightLatency, remLatency, deepLatency
v2.2.1Fixed obfuscation bug for sessionId in getTrackingStatus.
v2.2.2Android 14 compatibility has been addressed in the hotfix.
v2.3.0Average-stats, sleep_index are added.
Added functionality to continue the session.
Changed some functions to asynchronous processing.
v2.4.0Add snoring data to Report and Average Stats.
Add setPrivacySensitive during Recording.
2.4.1Added an optional ‘isPrivacySensitive’ parameter to ‘startSleepTracking()’ to optionally select the privacy sensitive feature of the AudioRecord. The default is true.
2.4.21. Added AsleepLogger Interface: A new interface, AsleepLogger, has been introduced, featuring four methods: d, e, i, and w.
2. Enhanced Configuration with Logging: The initAsleepConfig function has been updated to include an AsleepLogger parameter as its final argument.
3. Removed Direct Android Log Outputs: In alignment with our new logging approach, direct usage of the Android Log class within the SDK has been removed.

What’s Next