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