Class PowerUsage

Definition

Namespace:
Tizen.System
Assembly:
Tizen.System.PowerUsage.dll
API Level:
7
Privilege Level:
public
Privilege:
http://tizen.org/privilege/systemmonitor
Feature:
http://tizen.org/feature/battery

Provides information related to the power consumption by applications or by hardware resources on a battery-powered device for a given duration of time.

C#
Copy
public static class PowerUsage
Inheritance
System.Object
PowerUsage

Methods

View Source

GetPowerUsage(String, IList<PowerUsageResourceType>, DateTime, DateTime)

Gets the battery consumption in mAh(milli-Ampere hour) for the resources specified by the application in custom interval.

Declaration
C#
Copy
public static IDictionary<PowerUsageResourceType, double> GetPowerUsage(string appID, IList<PowerUsageResourceType> rtypes, DateTime start, DateTime end)
Parameters
Type Name Description
System.String appID

Application ID of the application for which battery usage is required.

System.Collections.Generic.IList<PowerUsageResourceType> rtypes

list of resource type identifiers like BLE, WiFi, CPU etc.

System.DateTime start

Start Time for data in DateTime.

System.DateTime end

End Time for data in DateTime.

Returns
Type Description
IDictionary<PowerUsageResourceType, System.Double>

Returns the battery consumption in mAh(milli-Ampere hour) for the resources specified by the application in custom interval.

Exceptions
Type Condition
System.ArgumentException

When an invalid parameter value is set.

UnauthorizedAccessException

If the privilege is not set.

System.InvalidOperationException

In case of any system error.

System.NotSupportedException

In case power usage is not supported

API Level: 7
Privilege Level: public
Privilege: http://tizen.org/privilege/systemmonitor
Feature: http://tizen.org/feature/battery
View Source

GetPowerUsage(String, DateTime, DateTime)

Gets the total battery usage in mAh(milli-Ampere hour) by an application for certain time interval.

Declaration
C#
Copy
public static double GetPowerUsage(string appID, DateTime start, DateTime end)
Parameters
Type Name Description
System.String appID

Application ID of the application for which battery usage is required.

System.DateTime start

Start Time for data in DateTime.

System.DateTime end

End Time for data in DateTime.

Returns
Type Description
System.Double

Returns the total battery usage in mAh(milli-Ampere hour) by an application for certain time interval.

Exceptions
Type Condition
System.ArgumentException

When an invalid parameter value is set.

UnauthorizedAccessException

If the privilege is not set.

System.InvalidOperationException

In case of any system error.

System.NotSupportedException

In case power usage is not supported

API Level: 7
Privilege Level: public
Privilege: http://tizen.org/privilege/systemmonitor
Feature: http://tizen.org/feature/battery
View Source

GetPowerUsage(String, PowerUsageResourceType, DateTime, DateTime)

Gets the battery consumption in mAh(milli-Ampere hour) for the specific resource for the given application in custom interval.

Declaration
C#
Copy
public static double GetPowerUsage(string appID, PowerUsageResourceType rtype, DateTime start, DateTime end)
Parameters
Type Name Description
System.String appID

Application ID of the application for which battery usage is required.

PowerUsageResourceType rtype

Identifier of resource type. BLE, WiFi, CPU etc.

System.DateTime start

Start Time for data in DateTime.

System.DateTime end

End Time for data in DateTime.

Returns
Type Description
System.Double

Returns the battery consumption in mAh(milli-Ampere hour) for the specific resource for the given application in custom interval.

Exceptions
Type Condition
System.ArgumentException

When an invalid parameter value is set.

UnauthorizedAccessException

If the privilege is not set.

System.InvalidOperationException

In case of any system error.

System.NotSupportedException

In case power usage is not supported

API Level: 7
Privilege Level: public
Privilege: http://tizen.org/privilege/systemmonitor
Feature: http://tizen.org/feature/battery
View Source

GetPowerUsage(PowerUsageResourceType, DateTime, DateTime)

Gets the battery usage in mAh(milli-Ampere hour) by a resource for certain time interval.

Declaration
C#
Copy
public static double GetPowerUsage(PowerUsageResourceType rtype, DateTime start, DateTime end)
Parameters
Type Name Description
PowerUsageResourceType rtype

Identifier of resource type. BLE, WiFi, CPU etc.

System.DateTime start

Start Time for data in DateTime.

System.DateTime end

End Time for data in DateTime.

Returns
Type Description
System.Double

Returns the battery usage in mAh(milli-Ampere hour) by a resource for certain time interval.

Exceptions
Type Condition
System.ArgumentException

When an invalid parameter value is set.

UnauthorizedAccessException

If the privilege is not set.

System.InvalidOperationException

In case of any system error.

System.NotSupportedException

In case power usage is not supported

API Level: 7
Privilege Level: public
Privilege: http://tizen.org/privilege/systemmonitor
Feature: http://tizen.org/feature/battery