public class DeviceCapability extends Object
You can use ResourceManager.getDeviceCapability() to obtain the device
capability and use
ResourceManager.updateConfiguration(Configuration, DeviceCapability) to update the
device capability.
ResourceManager| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
DEVICE_TYPE_CAR |
Indicates a car.
|
static int |
DEVICE_TYPE_PC |
Indicates a PC.
|
static int |
DEVICE_TYPE_PHONE |
Indicates a smartphone.
|
static int |
DEVICE_TYPE_TABLET |
Indicates a tablet.
|
static int |
DEVICE_TYPE_TV |
Indicates a smart TV.
|
static int |
DEVICE_TYPE_UNDEFINED |
Indicates that the device type is undefined.
|
static int |
DEVICE_TYPE_WEARABLE |
Indicates a wearable device.
|
int |
deviceType |
Indicates the target device type.
|
static int |
FLOAT_UNDEFINED |
Indicates that the dimension is undefined.
|
int |
height |
Indicates the screen height in virtual pixels (vps).
|
boolean |
isRound |
Specifies whether the screen is round-shaped.
|
boolean |
isWideColorGamut |
Indicates whether the screen has a wide color gamut.
|
static int |
SCREEN_DEFAULT |
Indicates that screen density is undefined.
|
static int |
SCREEN_LDPI |
Indicates large screen density.
|
static int |
SCREEN_MDPI |
Indicates medium screen density.
|
static int |
SCREEN_SDPI |
Indicates small screen density.
|
static int |
SCREEN_XLDPI |
Indicates extra-large screen density.
|
static int |
SCREEN_XXLDPI |
Indicates extra-extra-large screen density.
|
static int |
SCREEN_XXXLDPI |
Indicates extra-extra-extra-large screen density.
|
int |
screenDensity |
Indicates the target screen density.
|
int |
width |
Indicates the screen width in virtual pixels (vps).
|
| 构造器 | 说明 |
|---|---|
DeviceCapability() |
Default constructor used to create a
DeviceCapability instance. |
DeviceCapability(DeviceCapability capability) |
A constructor used to create a
DeviceCapability instance using an existing DeviceCapability
instance. |
public static final int DEVICE_TYPE_CAR
public static final int DEVICE_TYPE_PC
public static final int DEVICE_TYPE_PHONE
public static final int DEVICE_TYPE_TABLET
public static final int DEVICE_TYPE_TV
public static final int DEVICE_TYPE_UNDEFINED
public static final int DEVICE_TYPE_WEARABLE
public static final int FLOAT_UNDEFINED
public static final int SCREEN_DEFAULT
public static final int SCREEN_LDPI
public static final int SCREEN_MDPI
public static final int SCREEN_SDPI
public static final int SCREEN_XLDPI
public static final int SCREEN_XXLDPI
public static final int SCREEN_XXXLDPI
public int deviceType
public int height
public boolean isRound
public boolean isWideColorGamut
public int screenDensity
public int width
public DeviceCapability()
DeviceCapability instance.public DeviceCapability(DeviceCapability capability)
DeviceCapability instance using an existing DeviceCapability
instance. The two instances have the same attributes.capability - Indicates the existing DeviceCapability instance.public boolean equals(Object object)
equals 在类中 Objectobject - the provided objectObject.hashCode(),
HashMappublic int hashCode()
hashCode 在类中 ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)