Class BatteryStatistics
Definition
- Namespace:
- Tizen.Context.AppHistory
- Assembly:
- Tizen.Context.dll
This class provides APIs to query the battery consumption per application.
C#Copypublic class BatteryStatistics : AppStatistics
- Inheritance
Constructors
Declaration
C#Copypublic BatteryStatistics()
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Thrown when the method failed due to an internal error. |
| System.NotSupportedException | Thrown when the features are not supported. |
Declaration
C#Copypublic BatteryStatistics(BatteryStatistics.SortOrderType order)
Parameters
| Type | Name | Description |
|---|---|---|
| BatteryStatistics.SortOrderType | order | The criteria of the battery statistics sorted by. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when an invalid argument is used. |
| System.InvalidOperationException | Thrown when the method failed due to an internal error. |
| System.NotSupportedException | Thrown when the features are not supported. |
Properties
Declaration
C#Copypublic BatteryStatistics.SortOrderType SortOrder { get; }
Property Value
| Type | Description |
|---|---|
| BatteryStatistics.SortOrderType | The criteria of battery statistics sorted by. |
Methods
Declaration
C#Copypublic static DateTime GetLastFullyChargedTime()
Returns
| Type | Description |
|---|---|
| System.DateTime | The last time when the device was fully charged. |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown when the statistics is not supported. |
Declaration
C#Copypublic IReadOnlyList<BatteryStatisticsData> Query(DateTime startTime, DateTime endTime, uint resultSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | startTime | The start time of the data to be aggregated. |
| System.DateTime | endTime | The end time of the data to be aggregated. |
| uint | resultSize | The number of data records to be retrieved. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyList<T><BatteryStatisticsData> | Battery statistics data retrieved. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when an invalid argument is used. |
| System.InvalidOperationException | Thrown when an invalid operation occurs. |
| System.NotSupportedException | Thrown when the features are not supported. |
| System.UnauthorizedAccessException | Thrown when the application has no privilege to retrieve the application history. |
Declaration
C#Copypublic IReadOnlyList<BatteryStatisticsData> Query(DateTime startTime, DateTime endTime)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | startTime | The start time of the data to be aggregated. |
| System.DateTime | endTime | The end time of the data to be aggregated. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyList<T><BatteryStatisticsData> | Battery statistics data retrieved. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when an invalid argument is used. |
| System.InvalidOperationException | Thrown when invalid operation occurs. |
| System.NotSupportedException | Thrown when the features are not supported. |
| System.UnauthorizedAccessException | Thrown when the application has no privilege to retrieve the application history. |