Samsung Health Sensor SDK requires specific permissions. Depending on the HealthTrackerType you want to measure, the following permissions are required.
HealthTrackerType
Required permission (app's target version for Android 16 or higher)
If there is no permission, request the permission:
import androidx.core.app.ActivityCompat;
public class PermissionActivity extends FragmentActivity {
private ArrayList<String> mPermissions;
private static final String PERMISSION_KEY = "permissions";
private static final int PERMISSION_REQ_TAG = 1;
public void requestPermission(ArrayList<String> mPermissions) {
// ...
String[] permissions = new String[mPermissions.size()];
permissions = mPermissions.toArray(permissions);
ActivityCompat.requestPermissions(this, permissions, PERMISSION_REQ_TAG);
// ...
}
@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == PERMISSION_REQ_TAG) {
// ...
for (int p : grantResults) {
if (p == PackageManager.PERMISSION_DENIED) {
Log.i(TAG, "onRequestPermissionsResult : permission denied");
finish();
return;
}
}
// ...
}
}
The permission request displays a pop-up to get the user’s consent.
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.