com.android.sdklib.devices
Class Device

java.lang.Object
  extended by com.android.sdklib.devices.Device

public final class Device
extends java.lang.Object

Instances of this class contain the specifications for a device. Use the Device.Builder class to construct a Device object, or the DeviceParser if constructing device objects from XML conforming to the DeviceSchema standards.


Nested Class Summary
static class Device.Builder
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.List<Software> getAllSoftware()
          Returns all of the Software configurations of the Device.
 java.util.List<State> getAllStates()
          Returns all of the States the Device can be in.
 Hardware getDefaultHardware()
          Returns the default Hardware configuration for the device.
 State getDefaultState()
          Returns the default State of the Device.
 java.lang.String getDisplayName()
          Returns the user visible name of the Device.
 java.lang.String getId()
          Returns the id of the Device.
 java.lang.String getManufacturer()
          Returns the manufacturer of the Device.
 Meta getMeta()
          Returns the Meta object for the device, which contains meta information about the device, such as the location of icons.
 java.lang.String getName()
          Deprecated. Use getId() or getDisplayName() instead based on whether a stable identifier or a user visible name is needed
 java.awt.Dimension getScreenSize(com.android.resources.ScreenOrientation orientation)
           
 Software getSoftware(int apiVersion)
          Returns the software configuration for the given API version.
 State getState(java.lang.String name)
          Returns the state of the device with the given name.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

@NonNull
@Deprecated
public java.lang.String getName()
Deprecated. Use getId() or getDisplayName() instead based on whether a stable identifier or a user visible name is needed

Returns the name of the Device. This is intended to be displayed by the user and can vary over time. For a stable internal name of the device, use getId() instead.

Returns:
The name of the Device.

getDisplayName

@NonNull
public java.lang.String getDisplayName()
Returns the user visible name of the Device. This is intended to be displayed by the user and can vary over time. For a stable internal name of the device, use getId() instead.

Returns:
The name of the Device.

getId

@NonNull
public java.lang.String getId()
Returns the id of the Device.

Returns:
The id of the Device.

getManufacturer

@NonNull
public java.lang.String getManufacturer()
Returns the manufacturer of the Device.

Returns:
The name of the manufacturer of the Device.

getAllSoftware

@NonNull
public java.util.List<Software> getAllSoftware()
Returns all of the Software configurations of the Device.

Returns:
A list of all the Software configurations.

getAllStates

@NonNull
public java.util.List<State> getAllStates()
Returns all of the States the Device can be in.

Returns:
A list of all the States.

getDefaultHardware

@NonNull
public Hardware getDefaultHardware()
Returns the default Hardware configuration for the device. This is really just a shortcut for getting the Hardware on the default State

Returns:
The default Hardware for the device.

getMeta

@NonNull
public Meta getMeta()
Returns the Meta object for the device, which contains meta information about the device, such as the location of icons.

Returns:
The Meta object for the Device.

getDefaultState

@NonNull
public State getDefaultState()
Returns the default State of the Device.

Returns:
The default State of the Device.

getSoftware

@Nullable
public Software getSoftware(int apiVersion)
Returns the software configuration for the given API version.

Parameters:
apiVersion - The API version requested.
Returns:
The Software instance for the requested API version or null if the API version is unsupported for this device.

getState

@Nullable
public State getState(java.lang.String name)
Returns the state of the device with the given name.

Parameters:
name - The name of the state requested.
Returns:
The State object requested or null if there's no state with the given name.

getScreenSize

@Nullable
public java.awt.Dimension getScreenSize(@NonNull
                                                 com.android.resources.ScreenOrientation orientation)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object