次の方法で共有


UsageStatsManager Class

Definition

Provides access to device usage history and statistics.

[Android.Runtime.Register("android/app/usage/UsageStatsManager", DoNotGenerateAcw=true)]
public sealed class UsageStatsManager : Java.Lang.Object
[<Android.Runtime.Register("android/app/usage/UsageStatsManager", DoNotGenerateAcw=true)>]
type UsageStatsManager = class
    inherit Object
Inheritance
UsageStatsManager
Attributes

Remarks

Provides access to device usage history and statistics. Usage data is aggregated into time intervals: days, weeks, months, and years. <p /> When requesting usage data since a particular time, the request might look something like this:

PAST                   REQUEST_TIME                    TODAY                   FUTURE
            ————————————————————————————||———————————————————————————¦-----------------------|
                                   YEAR ||                           ¦                       |
            ————————————————————————————||———————————————————————————¦-----------------------|
             MONTH            |         ||                MONTH      ¦                       |
            ——————————————————|—————————||———————————————————————————¦-----------------------|
              |      WEEK     |     WEEK||    |     WEEK     |     WE¦EK     |      WEEK     |
            ————————————————————————————||———————————————————|———————¦-----------------------|
                                        ||           |DAY|DAY|DAY|DAY¦DAY|DAY|DAY|DAY|DAY|DAY|
            ————————————————————————————||———————————————————————————¦-----------------------|

A request for data in the middle of a time interval will include that interval. <p/> <b>NOTE:</b> Most methods on this API require the permission android.permission.PACKAGE_USAGE_STATS. However, declaring the permission implies intention to use the API and the user of the device still needs to grant permission through the Settings application. See android.provider.Settings#ACTION_USAGE_ACCESS_SETTINGS. Methods which only return the information for the calling package do not require this permission. E.g. #getAppStandbyBucket() and #queryEventsForSelf(long, long).

Java documentation for android.app.usage.UsageStatsManager.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

StandbyBucketActive
Obsolete.

The app was used very recently, currently in use or likely to be used very soon.

StandbyBucketFrequent
Obsolete.

The app was used in the last few days and/or likely to be used in the next few days.

StandbyBucketRare
Obsolete.

The app has not be used for several days and/or is unlikely to be used for several days.

StandbyBucketRestricted
Obsolete.

The app has not be used for several days, is unlikely to be used for several days, and has been misbehaving in some manner.

StandbyBucketWorkingSet
Obsolete.

The app was used recently and/or likely to be used in the next few hours.

Properties

AppStandbyBucket

Returns the current standby bucket of the calling app.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
IsAppInactive(String)

Returns whether the specified app is currently considered inactive.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
QueryAndAggregateUsageStats(Int64, Int64)

A convenience method that queries for all stats in the given range (using the best interval for that range), merges the resulting data, and keys it by package name.

QueryConfigurations(UsageStatsInterval, Int64, Int64)

Gets the hardware configurations the device was in for the given time range, aggregated by the specified interval.

QueryEvents(Int64, Int64)

Query for events in the given time range.

QueryEventsForSelf(Int64, Int64)

Like #queryEvents(long, long), but only returns events for the calling package.

QueryEventStats(UsageStatsInterval, Int64, Int64)

Gets aggregated event stats for the given time range, aggregated by the specified interval.

QueryUsageStats(UsageStatsInterval, Int64, Int64)

Gets application usage stats for the given time range, aggregated by the specified interval.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to