Getting Started

Get a more engaging and connective experience by integrating SanketLife SDK in your app across Android and iOS.




Requirement

  1. Android version 5.0+
  2. Bluetooth Low Energy
  3. Sanket Device
  4. Access Token
  5. Internet Connectivity

How to setup SanketLife SDK

  1. In the project’s main gradle.properties, add the following username/key shared to you for downloading the sanketlife sdk

    gradle.properties
    
    sanketlife_sdk_username=username_by_agatsa
    sanketlife_sdk_key=key_by_agatsa
    								

  2. In the project’s main build.gradle, add the following username/key shared to you for downloading the sanketlife sdk

    build.gradle
    
    allprojects {
    	repositories {
    		google()
    		jcenter()
    		maven {
    			url "http://35.234.214.192:8081/artifactory/sanketlife-sdk-release"
    			credentials {
    				username = "${sanketlife_sdk_username}"
    				password = "${sanketlife_sdk_key}"
    			}
    		}
    	}
    }
    								

  3. Add the following dependency in the application’s build.gradle in the app folder, in order to download the sanketlife file

    build.gradle
    
    implementation ("com.agatsa:sanketlife:4.0.2@aar") {
    	transitive = true
    }
    								



Register Sanket Device

How to integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();
initiateEcg.registerDevice(context,client_Id,new RegisterMyDeviceResponse(){
    @Override
    public void onSuccess(String s){

    }

    @Override
    public void onError(Errors errors){

    }

});
						

Where -


Parameter Definition

context - Application Context ( ex - getApplicationContext()).
client_Id - client id provided by sanket backend.
RegisterMyDeviceResponse  - Callback 
						


Take ECG

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();
initiateEcg.takeEcg(context,secret_Id,leadCount,new ResponseCallback(){
	@Override
	public void onSuccess(Success sucess){

	}

	@Override
	public void onError(Errors errors){

	}
});
						

Where -


Parameter Definition

context - Application Context ( ex - getApplicationContext()).
leadCount - Integer value for lead. 
secret_Id  - secret id provided by sanket backend.
success - Instance of success class
error - instance of error class.
ResponseCallback - Callback 
						



Take long recording of particular lead

Java

InitiateEcg initiateEcg = new InitiateEcg();
initiateEcg.takeLongEcg(context,secret_Id,leadCount,maxTime,new ResponseCallback(){
	@Override
	public void onSuccess(Success sucess){

	}

	@Override
	public void onError(Errors errors){

	}
});
						

Where -


Parameter Definition

context - Application Context ( ex - getApplicationContext()).
leadCount - Integer value for lead. 
secret_Id  - secret id provided by sanket backend.
success - Instance of success class
error - instance of error class.
maxTime - Number of seconds (Range - 10-60 seconds)
ResponseCallback - Callback 
						


Make PDF report of ECG taken

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();
initiateEcg.makeEcgReport(mContext, new UserDetails("Name", "Age", "Gender"), 
	filter,SECRET_ID, ecgConfig, new PdfCallback() {
		@Override
		public void onPdfAvailable(EcgConfig ecgConfig) {
								
		}
		@Override
		public void onError(Errors errors) {
								
		}
});
						

Where -


Parameter Definition

context - Application Context ( ex - getApplicationContext()).
userdetails  -  object of userdetails class having - name,age and gender.(optional)
filter  - For removing baseline and noise effect in ECG ( true or false ).
secret_Id  - secret id provided by sanket backend.
pdfpath - absolute path of pdf report of ecg stored in DCIM/Sanket folder in internal storage.
error - instance of error class.
ResponseCallback - Callback 
						

To get HRV parameters call the following methods

//To get Heart Rate :
ecgConfig.getHeartRate();

//To get PR :
ecgConfig.getpR();

//To get QT :
ecgConfig.getqT();

//To get QTC :
ecgConfig.getqTc();

//To get QRS :
ecgConfig.getqRs();

//To get SDNN :
ecgConfig.getSdnn();

//To get RMSSD :
ecgConfig.getRmssd();

//To get MRR :
ecgConfig.getmRR();

//To get Finding (where finding can be Tachycardia,Bradycardia,1st degree AV Block, Normal):
ecgConfig.getFinding();
							


Make PDF report of long recording

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();
initiateEcg.makeLongEcgReport(mContext, new UserDetails("Name", "Age", "Gender"), filter,
	SECRET_ID, ecgConfig, new LongPdfCallback() {
		@Override
		public void onPdfAvailable(LongEcgConfig longEcgConfig) {
							
		}
		@Override
		public void onError(Errors errors) {
							
		}
});
						

Where -


Parameter Definition

context - Application Context ( ex - getApplicationContext()).
userdetails  -  object of userdetails class having - name,age and gender.(optional)
filter  - For removing baseline and noise effect in ECG ( true or false ).
secret_Id  - secret id provided by sanket backend.
pdfpath - absolute path of pdf report of ecg stored in DCIM/Sanket folder in internal storage.
error - instance of error class.
ResponseCallback - Callback 
						

To get HRV parameters call the following methods

//To get Heart Rate :
longEcgConfig.getHeartRate();

//To get PR :
longEcgConfig.getpR();

//To get QT :
longEcgConfig.getqT();

//To get QTC :
longEcgConfig.getqTc();

//To get QRS :
longEcgConfig.getqRs();

//To get SDNN :
longEcgConfig.getSdnn();

//To get RMSSD :
longEcgConfig.getRmssd();

//To get MRR :
longEcgConfig.getmRR();

//To get Finding (where finding can be Tachycardia,Bradycardia,1st degree AV Block, Normal):
longEcgConfig.getFinding();
							


Save ECG offline

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

initiateEcg.saveEcgData(mContext, mUserID, new SaveEcgCallBack() { 
	@Override 
	public void onSuccess(Success success, EcgConfig ecgConfig) {
							
	} 

	@Override 
	public void onError(Errors error) { 

	} 
});						

Where -


Parameter Definition

mcontext - The application context required for internal methods
mUserID - The username/userID for which the data has to be saved in the DB. It is a STRING parameter to make it generic.
error - instance of error class.
SaveEcgCallback - The callback is used to listen to the save event. It returns following events
		onSuccess – which contains the Success and EcgConfig (It contains the ECG parameters which you can find in the end).
		onError – which contains Errors while saving the data. 
						


Save Long ECG offline

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

initiateEcg.saveLongEcgData(mContext, mUserID, new SaveLongEcgCallBack() { 
	@Override public void onSuccess(Success success, LongEcgConfig longEcgConfig) {
							
	} 
	@Override public void onError(Errors error) {

	} 
});						

Where -


Parameter Definition

mcontext - The application context required for internal methods
mUserID - The username/userID for which the data has to be saved in the DB. It is a STRING parameter to make it generic.
error - instance of error class.
SaveEcgCallback - The callback is used to listen to the save event. It returns following events
		onSuccess – which contains the Success and EcgConfig (It contains the ECG parameters which you can find in the end).
		onError – which contains Errors while saving the data. 
						


Create ECG offline

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

initiateEcg.makeEcgReport(mContext, new UserDetails("Name", "Age", "Gender"), filter, SECRET_ID, ecgConfig, new PdfCallback() { 

	@Override 
	public void onPdfAvailable(EcgConfig ecgConfig) {

	}
								
	@Override 
	public void onError(Errors errors) { 

	} 
});
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
UserDetails - The details of the user that will be printed on the PDF
mUserID - The username/userID for which the data has to be saved in the DB. It is a STRING parameter to make it generic.
SECRET_ID - The secret ID received from Sanket backend.
EcgConfig - The config that was returned earlier.
error - instance of error class.
PdfCallback - The PDF callback is used to listen to the events of the PDF generation which returns the following:
		onPdfAvailable – which contains the EcgConfig parameters
		onError – which contains the Errors in the pdf generation.
						


Create Long ECG offline

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

initiateEcg.makeEcgReport(mContext, new UserDetails("Name", "Age", "Gender"), filter, SECRET_ID, longEcgConfig, new LongPdfCallback() { 

	@Override 
	public void onPdfAvailable(LongEcgConfig longEcgConfig) {

	}
								
	@Override 
	public void onError(Errors errors) { 

	} 
});
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
UserDetails - The details of the user that will be printed on the PDF
mUserID - The username/userID for which the data has to be saved in the DB. It is a STRING parameter to make it generic.
SECRET_ID - The secret ID received from Sanket backend.
LongEcgConfig - The config that was returned earlier.
error - instance of error class.
LongPdfCallback - The PDF callback is used to listen to the events of the PDF generation which returns the following:
		onPdfAvailable – which contains the EcgConfig parameters
		onError – which contains the Errors in the pdf generation.
						


Fetch list of Un-Synced ECG

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

List<EcgConfig> ecgConfigList = initiateEcg.getListOfUnsyncedEcg(mContext, mUSerID);
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
mUserID - The username/userID for which the data has to be saved in the DB. It is a STRING parameter to make it generic.
						


Fetch list of Un-Synced ECG

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

List<EcgConfig> longEcgConfigList = initiateEcg.getListOfUnsyncedLongEcg(mContext, mUserID);
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
mUserID - The username/userID for which the data has to be saved in the DB. It is a STRING parameter to make it generic.
						


Sync ECG data

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

initiateEcg.syncEcgData(getApplicationContext(), ecgConfig, new UserDetails("Vikas", "24", "Male"), filter, SECRET_ID, new SyncEcgCallBack() { 
	@Override 
	public void onSuccess(Success success, EcgConfig ecgConfig) {

	} 
	
	@Override 
	public void onError(Errors errors) { 

	} 
});
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
UserDetails - The details of the user that will be printed on the PDF
SECRET_ID - The secret ID received from Sanket backend.
EcgConfig - The config that was returned earlier.
Filter - The filter whether to filter the ECG signals while printing or not.
error - instance of error class.
SyncEcgCallback - The PDF callback is used to listen to the events of the PDF generation which returns the following:
		onPdfAvailable – which contains the EcgConfig parameters
		onError – which contains the Errors in the pdf generation.
														
						


Sync offline long ECG data

How to Integrate -


Java

InitiateEcg initiateEcg = new InitiateEcg();

initiateEcg.syncLongEcgData(mContext, longEcgConfig, new UserDetails("Name", "Age", "Gender"), filter, SECRET_ID, new SyncLongEcgCallBack() { 
	@Override 
	public void onSuccess(Success success, LongEcgConfig longEcgConfig) { 

	} 
	
	@Override 
	public void onError(Errors errors) {  

	} 
});
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
UserDetails - The details of the user that will be printed on the PDF
SECRET_ID - The secret ID received from Sanket backend.
LongEcgConfig - The config that was returned earlier.
Filter - The filter whether to filter the ECG signals while printing or not.
error - instance of error class.
SyncLongEcgCallback - The PDF callback is used to listen to the events of the PDF generation which returns the following:
		onPdfAvailable – which contains the LongEcgConfig parameters
		onError – which contains the Errors in the pdf generation.
														
						


Take Temperature using SanketLife Multivital

The following function is used to take temperature when using Sanketlife Multivital:


Java

InitiateVitals initiateVitals = new InitiateVitals();
initiateVitals.takeTemperature(mContext, SECRET_ID, new TemperatureResponseCallback() {
	@Override
	public void onError(Errors errors) {
		Log.e("Taking Temperature", errors.getErrorMsg());
	}
	@Override
	public void onSuccess(Success success, TempConfig tempConfig) {
		Log.e("Temp Taken: ", tempConfig.temperature + " F");
	}
});
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
SECRET_ID - The secret ID received from Sanket backend.														
TemperatureResponseCallback() - An interface to be used which will return the both the error and success
parameters while taking temperature
onError(Errors errors) - This method returns any error that occurred while taking temperature when
using the multivital.
onSuccess(Success success, TempConfig tempconfig) - This method returns the success parameter
while taking temperature.
TempConfig - TempConfig contains all the parameters that are required in order to save the
results on the SDK user’s application’s server/database. It contains the following parameters:
deviceId -The deviceId of the device from which the reading has been taken.
temperature - The temperature recorded in Fahrenheit by the device 
temperatureArray - The temperature array of type Double which contains the multiple
recording during the recording
phoneModel - The Android Device from which the temperature has been taken
osVersion -The os version of the Android Device
firmwareVersion -The firmwareVersion of the SanketLife device that is being used.
epocTimestamp - The timestamp in the epoc format.

						


Take Spo2 using SanketLife Multivital

The following function is used to take Spo2 when using Sanketlife Multivital:


Java

InitiateVitals initiateVitals = new InitiateVitals();
initiateVitals.takeSpo2(mContext, SECRET_ID , new Spo2ResponseCallback() {
	@Override
		public void onError(Errors errors) {
			Log.e("Taking Spo2", errors.getErrorMsg());
		}
	@Override
		public void onSuccess(Success success, Spo2Config spo2Config) {
			Log.e("Spo2 Taken", spo2Config.spo2 + "");
		}
});
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
SECRET_ID - The secret ID received from Sanket backend.														
Spo2ResponseCallback() - An interface to be used which will return the both the error and success
parameters while taking spo2
onError(Errors errors) - This method returns any error that occurred while taking spo2 when
using the multivital.
onSuccess(Success success, Spo2Config spo2Config) – - This method returns the success parameter
while taking temperature.
spo2Config - TempConfig contains all the parameters that are required in order to save the
results on the SDK user’s application’s server/database. It contains the following parameters:
deviceId -The deviceId of the device from which the reading has been taken.
spo2 - The spo2 recorded in percent by the device 
spo2Array - The spo2 array of type Integer which contains the multiple values recorded
during the recording
phoneModel - The Android Device from which the spo2 has been taken
osVersion -The os version of the Android Device
firmwareVersion -The firmwareVersion of the SanketLife device that is being used.
epocTimestamp - The timestamp in the epoc format.

						


Take BP using SanketLife Multivital

The following function is used to take BP when using Sanketlife Multivital:


Java

InitiateVitals initiateVitals = new InitiateVitals();
initiateVitals.takebp(mContext, SECRET_ID , new bpResponseCallback() {
	@Override
	public void onError(Errors errors) {
		Log.e("Taking bp", errors.getErrorMsg());
	}
	@Override
	public void onSuccess(Success success, bpConfig bpConfig) {
		Log.e("bp Taken", bpConfig.bp + "");
	}
});
						

Where -


Parameter Definition

mcontext - The application context required for internal methods
SECRET_ID - The secret ID received from Sanket backend.														
BPResponseCallback() - An interface to be used which will return the both the error and success
parameters while taking bp
onError(Errors errors) - This method returns any error that occurred while taking bp when
using the multivital.
onSuccess(Success success, Spo2Config spo2Config) – - This method returns the success parameter
while taking bp.
bpConfig - TempConfig contains all the parameters that are required in order to save the
results on the SDK user’s application’s server/database. It contains the following parameters:
deviceId -The deviceId of the device from which the reading has been taken.
systolic - The systolic recorded in mmHg by the SanketLife device 
systolicArray - The temperature array of type Double which contains the multiple
recording during the recording
diastolic - The diastolic recorded in mmHg by the SanketLife device 
diastolicArray - The diastolic array of type Integer which contains the multiple values
recorded during the recording
phoneModel - The Android Device from which the temperature has been taken
osVersion -The os version of the Android Device
firmwareVersion -The firmwareVersion of the SanketLife device that is being used.
epocTimestamp - The timestamp in the epoc format.

						


What else?

You can request for an access token from API Catalogue feature in the menu section.To get a free trial of our SDK today - please reach us email : info@agatsa.com phone: +91-1140844783