Class Vibrator
Definition
- Namespace:
- Tizen.System
- Assembly:
- Tizen.System.dll
- API Level:
- 3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/haptic
- Feature:
- http://tizen.org/feature/feedback.vibration
The Vibrator class provides the properties and methods to control a vibrator.
C#Copypublic class Vibrator : IDisposable
- Inheritance
-
Vibrator
Remarks
The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.
Examples
CopyConsole.WriteLine("Total number of Vibrators are: {0}", Tizen.System.Vibrator.NumberOfVibrators);
Properties
Declaration
C#Copypublic static int NumberOfVibrators { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: 3
Declaration
C#Copypublic static IReadOnlyList<Vibrator> Vibrators { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<Vibrator> |
API Level: 3
Methods
Dispose()
Dispose API for closing the internal resources. This function can be used to stop all the effects started by Vibrate().
Declaration
C#Copypublic void Dispose()
API Level: 3
Dispose(Boolean)
Dispose API for closing the internal resources. This function can be used to stop all the effects started by Vibrate().
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
API Level: 3
Declaration
C#Copyprotected void Finalize()
Stop()
Stops all the vibration effects which are being played. This function can be used to stop all the effects started by Vibrate().
Declaration
C#Copypublic void Stop()
Examples
CopyVibrator vibrator = Vibrator.Vibrators[0]; try { vibrator.Stop(); } catch(Exception e) { }
API Level: 3
Feature: http://tizen.org/feature/feedback.vibration
Vibrate(Int32, Int32)
Vibrates during the specified time with a constant intensity. This function can be used to start monotonous vibration for the specified time.
Declaration
C#Copypublic void Vibrate(int duration, int feedback)
Parameters
Type | Name | Description |
---|---|---|
Int32 | duration | The play duration in milliseconds. |
Int32 | feedback | The amount of the intensity variation (0 ~ 100). |
Examples
CopyVibrator vibrator = Vibrator.Vibrators[0]; try { vibrator.Vibrate(2000, 70); } catch(Exception e) { }