com.android.sdklib
Class SystemImage

java.lang.Object
  extended by com.android.sdklib.SystemImage
All Implemented Interfaces:
ISystemImage, java.lang.Comparable<ISystemImage>

public class SystemImage
extends java.lang.Object
implements ISystemImage

Describes a system image as used by an IAndroidTarget. A system image has an installation path, a location type and an ABI type.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.android.sdklib.ISystemImage
ISystemImage.LocationType
 
Field Summary
static java.lang.String ANDROID_PREFIX
           
 
Constructor Summary
SystemImage(java.io.File location, ISystemImage.LocationType locationType, java.lang.String abiType)
          Creates a SystemImage description for an existing system image folder.
SystemImage(SdkManager sdkManager, IAndroidTarget target, ISystemImage.LocationType locationType, java.lang.String abiType)
          Creates a SystemImage description for a non-existing system image folder.
 
Method Summary
 int compareTo(ISystemImage other)
           
 java.lang.String getAbiType()
          Returns the ABI type.
static java.io.File getCanonicalFolder(java.lang.String sdkOsPath, AndroidVersion platformVersion, java.lang.String abiType)
          Static helper method that returns the canonical path for a system-image that uses the ISystemImage.LocationType.IN_SYSTEM_IMAGE location type.
 java.io.File getLocation()
          Returns the actual location of an installed system image.
 ISystemImage.LocationType getLocationType()
          Indicates the location strategy for this system image in the SDK.
 java.lang.String toString()
          Generates a string representation suitable for debug purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANDROID_PREFIX

public static final java.lang.String ANDROID_PREFIX
See Also:
Constant Field Values
Constructor Detail

SystemImage

public SystemImage(java.io.File location,
                   ISystemImage.LocationType locationType,
                   java.lang.String abiType)
Creates a SystemImage description for an existing system image folder.

Parameters:
location - The location of an installed system image.
locationType - Where the system image folder is located for this ABI.
abiType - The ABI type. For example, one of SdkConstants.ABI_ARMEABI, SdkConstants.ABI_ARMEABI_V7A, SdkConstants.ABI_INTEL_ATOM or SdkConstants.ABI_MIPS.

SystemImage

public SystemImage(SdkManager sdkManager,
                   IAndroidTarget target,
                   ISystemImage.LocationType locationType,
                   java.lang.String abiType)
Creates a SystemImage description for a non-existing system image folder. The actual location is computed based on the locationtype.

Parameters:
sdkManager - The current SDK manager.
locationType - Where the system image folder is located for this ABI.
abiType - The ABI type. For example, one of SdkConstants.ABI_ARMEABI, SdkConstants.ABI_ARMEABI_V7A, SdkConstants.ABI_INTEL_ATOM or SdkConstants.ABI_MIPS.
Throws:
java.lang.IllegalArgumentException - if the target used for ISystemImage.LocationType.IN_SYSTEM_IMAGE is not a PlatformTarget.
Method Detail

getCanonicalFolder

public static java.io.File getCanonicalFolder(java.lang.String sdkOsPath,
                                              AndroidVersion platformVersion,
                                              java.lang.String abiType)
Static helper method that returns the canonical path for a system-image that uses the ISystemImage.LocationType.IN_SYSTEM_IMAGE location type.

Such an image is located in SDK/system-images/android-N/abiType. For this reason this method requires the root SDK as well as the platform and the ABI type.

Parameters:
sdkOsPath - The OS path to the SDK.
platformVersion - The platform version.
abiType - An optional ABI type. If null, the parent directory is returned.
Returns:
A file that represents the location of the canonical system-image folder for this configuration.

getLocation

public java.io.File getLocation()
Returns the actual location of an installed system image.

Specified by:
getLocation in interface ISystemImage

getLocationType

public ISystemImage.LocationType getLocationType()
Indicates the location strategy for this system image in the SDK.

Specified by:
getLocationType in interface ISystemImage

getAbiType

public java.lang.String getAbiType()
Returns the ABI type. For example, one of SdkConstants.ABI_ARMEABI, SdkConstants.ABI_ARMEABI_V7A, SdkConstants.ABI_INTEL_ATOM or SdkConstants.ABI_MIPS. Cannot be null nor empty.

Specified by:
getAbiType in interface ISystemImage

compareTo

public int compareTo(ISystemImage other)
Specified by:
compareTo in interface java.lang.Comparable<ISystemImage>

toString

public java.lang.String toString()
Generates a string representation suitable for debug purposes. The string is not intended to be displayed to the user.

Overrides:
toString in class java.lang.Object