DISTRIBUTION OF TIZEN-BASED WATCH APPS HAS BEEN DISCONTINUED
Use the Samsung Accessory Protocol (SAP) API
To use the SAP API, change some configurations in your application project:
Add the Accessory Service Profile.
Communicating with an Android application requires a declaration of descriptions about the Accessory Service Profile. The profile is declared in a separate XML file in the /res/xml folder of the application project. The actual path of the XML file can be described with ‘meta data’ in the config.xml file.
A. Add the accessoryservices.xml file in the /res/xml folder.
For an example file, see the following sample Accessory Service Profile. You can modify the id value of the serviceProfile element to define your application. The id value must be unique globally and it is also used in the Android side application to identify the service profile.
Note :
The service profile ID must start with ‘/’, followed by [0-9], [a-z], ‘_’, and ‘/’ (as delimiter). The maximum length is 30 characters. For more information about the XML file, see this.
```xml
<resources>
<application name="MyApplication">
<serviceProfile id="/org/example/myapp/my_message" name="MyMessage"
role="consumer" version="1.0">
<supportedTransports>
<transport type="TRANSPORT_BT"/>
<transport type="TRANSPORT_WIFI"/>
</supportedTransports>
<serviceChannel id="110" dataRate="low" priority="low"
reliability="enable">
</serviceChannel>
</serviceProfile>
</application>
</resources>
```
B. Add meta data to define the Accessory Service Profile XML file location.
Open the `config.xml` file in the Web application configuration editor, select the **Tizen** tab. In the Meta data section, click **Add**, define the key as **AccessoryServicesLocation** and the value as **/res/xml/accessoryservices.xml**, and click **OK**.

Add the required privilege.
To use the SAP API, the http://developer.samsung.com/tizen/privilege/accessoryprotocol privilege must be added in the config.xml file.
Open the config.xml file in the Web application configuration editor, select the Privileges tab, and click Add.
Add the privilege and click OK.
SAMSUNG and Cookies
Our site uses cookies, including optional cookies to provide you with the best experience on our website and relevant advertising based on your use of our site, You can manage your preferences or accept all cookies.
You can also read our Privacy Policy and Cookie Policy.
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.