Class Feedback
Definition
- Namespace:
- Tizen.System
- Assembly:
- Tizen.System.Feedback.dll
- API Level:
- 3
- Privilege Level:
- public
- Privilege:
- For controlling the haptic device: http://tizen.org/privilege/haptic For controlling the sound, privilege is not needed.
The Feedback API provides functions to control haptic and sound. The Feedback API provides the way to play and stop feedback, and get the information whether a specific pattern is supported. Below is the supported pattern string: Tap SoftInputPanel Key0 Key1 Key2 Key3 Key4 Key5 Key6 Key7 Key8 Key9 KeyStar KeySharp KeyBack Hold HardwareKeyPressed HardwareKeyHold Message Email WakeUp Schedule Timer General PowerOn PowerOff ChargerConnected ChargingError FullyCharged LowBattery Lock UnLock VibrationModeAbled SilentModeDisabled BluetoothDeviceConnected BluetoothDeviceDisconnected ListReorder ListSlider VolumeKeyPressed
public class Feedback
- Inheritance
-
Feedback
Examples
Feedback feedback = new Feedback();
bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
Constructors
View SourceFeedback()
Constructor of Feedback class
Declaration
public Feedback()
Examples
Feedback feedback = new Feedback();
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when failed because the devices (vibration and sound) are not supported. |
InvalidOperationException | Thrown when failed because of a system error. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/haptic
Feature: http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
Methods
View SourceFinalize()
Finalizes an instance of the Feedback class.
Declaration
protected void Finalize()
IsSupportedPattern(FeedbackType, String)
Gets the supported information about a specific type and pattern.
Declaration
public bool IsSupportedPattern(FeedbackType type, string pattern)
Parameters
Type | Name | Description |
---|---|---|
FeedbackType | type | The feedback type. |
String | pattern | The feedback pattern string. |
Returns
Type | Description |
---|---|
Boolean | Information whether a pattern is supported. |
Remarks
Now, IsSupportedPattern is not working for FeedbackType.All. This API is working for FeedbackType.Sound and FeedbackType.Vibration only. If you use FeedbackType.All for type parameter, this API will throw ArgumentException. To get the supported information for Vibration type, the application should have http://tizen.org/privilege/haptic privilege.
Examples
Feedback feedback = new Feedback();
bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
Exceptions
Type | Condition |
---|---|
Exception | Thrown when failed because the feedback is not initialized. |
ArgumentException | Thrown when failed because of an invalid arguament. |
NotSupportedException | Thrown when failed becuase the device (haptic, sound) is not supported. |
UnauthorizedAccessException | Thrown when failed because the access is not granted (No privilege). |
InvalidOperationException | Thrown when failed because of a system error. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/haptic
Feature: http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
View SourcePlay(FeedbackType, String)
Plays a specific feedback pattern.
Declaration
public void Play(FeedbackType type, string pattern)
Parameters
Type | Name | Description |
---|---|---|
FeedbackType | type | The feedback type. |
String | pattern | The feedback pattern string. |
Remarks
To play Vibration type, app should have http://tizen.org/privilege/haptic privilege.
Examples
Feedback feedback = new Feedback();
feedback.Play(FeedbackType.All, "Tap");
Exceptions
Type | Condition |
---|---|
Exception | Thrown when failed because feedback is not initialized. |
ArgumentException | Thrown when failed because of an invalid arguament. |
NotSupportedException | Thrown when failed because the device (haptic, sound) or a specific pattern is not supported. |
UnauthorizedAccessException | Thrown when failed because the access is not granted(No privilege) |
InvalidOperationException | Thrown when failed because of a system error. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/haptic
Feature: http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
View SourceStop()
Stops to play the feedback.
Declaration
public void Stop()
Remarks
To stop vibration, the application should have http://tizen.org/privilege/haptic privilege.
Examples
Feedback Feedback1 = new Feedback();
Feedback1.Stop();
Exceptions
Type | Condition |
---|---|
Exception | Thrown when failed because the feedback is not initialized. |
ArgumentException | Thrown when failed because of an invalid arguament |
NotSupportedException | Thrown when failed because the device (haptic, sound) or a specific pattern is not supported. |
UnauthorizedAccessException | Thrown when failed because the access is not granted (No privilege). |
InvalidOperationException | Thrown when failed because of a system error. |