Samsung Health API is not working (for android device)

I’m making Android Native app with kotlin.

I was check your docs and downloaded API and insert my project.
(location is : ~projectroot/app/libs/samsung-health-data-1.5.0.arr)

And I was add permissions.



    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>

    <uses-permission android:name=""/>
    <uses-permission android:name=""/>
    <uses-permission android:name="android.permission.BODY_SENSORS"/>

    <!--삼성 SDK-->
        <package android:name="" />


<!--삼성 SDK 권한-->
            android:value=";" />



Add build.gradle too.

    /*Samsung sdk*/
    implementation files('libs/samsung-health-data-1.5.0.aar')

And request permissions on my MainActivity.


private fun initDataStore() {
        mKeySet = HashSet()
        mKeySet.add(PermissionKey(Exercise.HEALTH_DATA_TYPE, PermissionType.READ))
        mKeySet.add(PermissionKey(Exercise.HEALTH_DATA_TYPE, PermissionType.WRITE))
        mKeySet.add(PermissionKey(StepDailyTrend.HEALTH_DATA_TYPE, PermissionType.READ))
        mKeySet.add(PermissionKey(HealthConstants.StepCount.HEALTH_DATA_TYPE, PermissionType.READ))

        mStore = HealthDataStore(this, mCntListener)


private val mCntListener: ConnectionListener = object : ConnectionListener {
        override fun onConnected() {
            Log.d(TAG, "Health data service is connected.")

            val mManager = HealthPermissionManager(mStore)
            val resultMap : MutableMap<PermissionKey, Boolean> = mManager.isPermissionAcquired(mKeySet)
            if(resultMap.containsValue(false)) {
                mManager.requestPermissions(mKeySet, this).setResultListener(mPermissionListener)

but every resultMap is false.

And I can see the UI (blowing the image), but I can’t touch the checkbox. (maybe because of resultMAp is false…?)

How can I use the Health API ?

Do you have partnership for Samsung Health SDK?

No, I just add Sdk. Do I have to need partnership?
How can I have partnership for Samsung health SDK?

And I wanna just study for my app, so I don’t have any plan to open for Play Store app market.

Yes, you need partnership to use the SDK. But currently Samsung Health SDK partnership is unavailable. You can access Samsung Health data using Health connect API.
Hope this guide will help you: Accessing Samsung Health Data through Health Connect | Samsung Developer