Sound and Vibration Feedback

You can play sound and vibration feedback with a specific pattern.

The main features of the Tizen.System.Feedback class are:

Prerequisites

To enable your application to use the feedback functionality:

  1. To use vibration feedback, the application has to request permission by adding the following privilege to the tizen-manifest.xml file:

    XML
    Copy
    <privileges> <privilege>http://tizen.org/privilege/haptic</privilege> </privileges>
  2. To use the methods and properties of the Tizen.System.Feedback class, include the Tizen.System namespace in your application:

    C#
    Copy
    using Tizen.System;

Play feedback with a specific type and pattern

To play a specific feedback pattern with a specific feedback type, follow these steps:

  1. Create a new instance of the Tizen.System.Feedback class:

    C#
    Copy
    Feedback feedback = new Feedback();
  2. Play the feedback with the Play() method of the Tizen.System.Feedback class. As parameters, enter the feedback type (defined by the Tizen.System.FeedbackType enumeration), and a string to denote the pattern to be played:

    C#
    Copy
    feedback.Play(FeedbackType.Sound, "Tap");
  3. To stop the feedback, use the Stop() method:

    C#
    Copy
    feedback.Stop();

Check for pattern support

To determine whether a specific pattern is supported for a specific feedback type, use the IsSupportedPattern() method of the Tizen.System.Feedback class:

C#
Copy
bool support; Feedback feedback = new Feedback(); support = feedback.IsSupportedPattern(FeedbackType.Vibration, "Key0");

The return value defines whether the pattern is supported for the feedback type.

  • Dependencies
    • Tizen 4.0 and Higher
System Settings
Next Telephony
Submit your feedback to GitHub