Class BatteryStatistics
Definition
- Namespace:
- Tizen.Context.AppHistory
- Assembly:
- Tizen.Context.dll
- API Level:
- 4
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 |
---|---|
InvalidOperationException | Thrown when the method failed due to an internal error. |
NotSupportedException | Thrown when the features are not supported. |
API Level: 4
Feature: http://tizen.org/feature/app_historyhttp://tizen.org/feature/battery
View SourceBatteryStatistics(BatteryStatistics.SortOrderType)
The constructor of BatteryStatistics class.
Declaration
public BatteryStatistics(BatteryStatistics.SortOrderType order)
Parameters
Type | Name | Description |
---|---|---|
BatteryStatistics.SortOrderType | order | The criteria of the battery statistics sorted by. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when an invalid argument is used. |
InvalidOperationException | Thrown when the method failed due to an internal error. |
NotSupportedException | Thrown when the features are not supported. |
API Level: 4
Feature: http://tizen.org/feature/app_historyhttp://tizen.org/feature/battery
Properties
View SourceSortOrder
Gets the criteria of battery statistics sorted by.
Declaration
public BatteryStatistics.SortOrderType SortOrder { get; }
Property Value
Type | Description |
---|---|
BatteryStatistics.SortOrderType | The criteria of battery statistics sorted by. |
API Level: 4
Methods
View SourceGetLastFullyChargedTime()
Gets the last time when the device was fully charged.
Declaration
public static DateTime GetLastFullyChargedTime()
Returns
Type | Description |
---|---|
DateTime | The last time when the device was fully charged. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the statistics is not supported. |
API Level: 4
Feature: http://tizen.org/feature/app_historyhttp://tizen.org/feature/battery
View SourceQuery(DateTime, DateTime)
Retrieves a given type of battery statistics.
Declaration
public IReadOnlyList<BatteryStatisticsData> Query(DateTime startTime, DateTime endTime)
Parameters
Type | Name | Description |
---|---|---|
DateTime | startTime | The start time of the data to be aggregated. |
DateTime | endTime | The end time of the data to be aggregated. |
Returns
Type | Description |
---|---|
IReadOnlyList<BatteryStatisticsData> | Battery statistics data retrieved. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when an invalid argument is used. |
InvalidOperationException | Thrown when invalid operation occurs. |
NotSupportedException | Thrown when the features are not supported. |
UnauthorizedAccessException | Thrown when the application has no privilege to retrieve the application history. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/apphistory.read
Feature: http://tizen.org/feature/app_historyhttp://tizen.org/feature/battery
View SourceQuery(DateTime, DateTime, UInt32)
Retrieves a given type of battery statistics.
Declaration
public IReadOnlyList<BatteryStatisticsData> Query(DateTime startTime, DateTime endTime, uint resultSize)
Parameters
Type | Name | Description |
---|---|---|
DateTime | startTime | The start time of the data to be aggregated. |
DateTime | endTime | The end time of the data to be aggregated. |
UInt32 | resultSize | The number of data records to be retrieved. |
Returns
Type | Description |
---|---|
IReadOnlyList<BatteryStatisticsData> | Battery statistics data retrieved. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when an invalid argument is used. |
InvalidOperationException | Thrown when an invalid operation occurs. |
NotSupportedException | Thrown when the features are not supported. |
UnauthorizedAccessException | Thrown when the application has no privilege to retrieve the application history. |