PlatformTargetpublic final class PlatformTarget extends Object implements IAndroidTargetRepresents a platform target in the SDK. |
Fields Summary |
---|
private static final String | PLATFORM_HASHString used to get a hash to the platform target | private static final String | PLATFORM_VENDOR | private static final String | PLATFORM_NAME | private final String | mLocation | private final String | mName | private final int | mApiVersionNumber | private final String | mApiVersionName | private final Map | mProperties | private final Map | mPaths | private String[] | mSkins |
Constructors Summary |
---|
PlatformTarget(String location, Map properties, int apiNumber, String apiName)
mName = String.format(PLATFORM_NAME, apiName);
if (location.endsWith(File.separator) == false) {
location = location + File.separator;
}
mLocation = location;
mProperties = Collections.unmodifiableMap(properties);
mApiVersionNumber = apiNumber;
mApiVersionName = apiName;
// pre-build the path to the platform components
mPaths.put(ANDROID_JAR, mLocation + SdkConstants.FN_FRAMEWORK_LIBRARY);
mPaths.put(SOURCES, mLocation + SdkConstants.FD_ANDROID_SOURCES);
mPaths.put(ANDROID_AIDL, mLocation + SdkConstants.FN_FRAMEWORK_AIDL);
mPaths.put(IMAGES, mLocation + SdkConstants.OS_IMAGES_FOLDER);
mPaths.put(SAMPLES, mLocation + SdkConstants.OS_PLATFORM_SAMPLES_FOLDER);
mPaths.put(SKINS, mLocation + SdkConstants.OS_SKINS_FOLDER);
mPaths.put(TEMPLATES, mLocation + SdkConstants.OS_PLATFORM_TEMPLATES_FOLDER);
mPaths.put(DATA, mLocation + SdkConstants.OS_PLATFORM_DATA_FOLDER);
mPaths.put(ATTRIBUTES, mLocation + SdkConstants.OS_PLATFORM_ATTRS_XML);
mPaths.put(MANIFEST_ATTRIBUTES, mLocation + SdkConstants.OS_PLATFORM_ATTRS_MANIFEST_XML);
mPaths.put(RESOURCES, mLocation + SdkConstants.OS_PLATFORM_RESOURCES_FOLDER);
mPaths.put(FONTS, mLocation + SdkConstants.OS_PLATFORM_FONTS_FOLDER);
mPaths.put(LAYOUT_LIB, mLocation + SdkConstants.OS_PLATFORM_DATA_FOLDER +
SdkConstants.FN_LAYOUTLIB_JAR);
mPaths.put(WIDGETS, mLocation + SdkConstants.OS_PLATFORM_DATA_FOLDER +
SdkConstants.FN_WIDGETS);
mPaths.put(ACTIONS_ACTIVITY, mLocation + SdkConstants.OS_PLATFORM_DATA_FOLDER +
SdkConstants.FN_INTENT_ACTIONS_ACTIVITY);
mPaths.put(ACTIONS_BROADCAST, mLocation + SdkConstants.OS_PLATFORM_DATA_FOLDER +
SdkConstants.FN_INTENT_ACTIONS_BROADCAST);
mPaths.put(ACTIONS_SERVICE, mLocation + SdkConstants.OS_PLATFORM_DATA_FOLDER +
SdkConstants.FN_INTENT_ACTIONS_SERVICE);
mPaths.put(CATEGORIES, mLocation + SdkConstants.OS_PLATFORM_DATA_FOLDER +
SdkConstants.FN_INTENT_CATEGORIES);
mPaths.put(AAPT, mLocation + SdkConstants.OS_SDK_TOOLS_FOLDER + SdkConstants.FN_AAPT);
mPaths.put(AIDL, mLocation + SdkConstants.OS_SDK_TOOLS_FOLDER + SdkConstants.FN_AIDL);
mPaths.put(DX, mLocation + SdkConstants.OS_SDK_TOOLS_FOLDER + SdkConstants.FN_DX);
mPaths.put(DX_JAR, mLocation + SdkConstants.OS_SDK_TOOLS_LIB_FOLDER +
SdkConstants.FN_DX_JAR);
|
Methods Summary |
---|
public int | compareTo(IAndroidTarget target)
if (target.isPlatform() == false) {
return -1;
}
return mApiVersionNumber - target.getApiVersionNumber();
| public boolean | equals(java.lang.Object obj)
if (obj instanceof PlatformTarget) {
return mApiVersionNumber == ((PlatformTarget)obj).mApiVersionNumber;
}
return super.equals(obj);
| public java.lang.String | getApiVersionName()
return mApiVersionName;
| public int | getApiVersionNumber()
return mApiVersionNumber;
| public java.lang.String | getClasspathName()
return mName;
| public java.lang.String | getDefaultSkin()
// at this time, this is the default skin for all the platform.
return "HVGA";
| public java.lang.String | getDescription()
return String.format("Standard Android platform %s", mApiVersionName);
| public java.lang.String | getFullName()
return mName;
| public java.lang.String | getLocation()
return mLocation;
| public java.lang.String | getName()
return mName;
| public IOptionalLibrary[] | getOptionalLibraries()
return null;
| public IAndroidTarget | getParent()
return null;
| public java.lang.String | getPath(int pathId)
return mPaths.get(pathId);
| public java.util.Map | getProperties()
return mProperties; // mProperties is unmodifiable.
| public java.lang.String | getProperty(java.lang.String name)
return mProperties.get(name);
| public java.lang.String[] | getSkins()
return mSkins;
| public java.lang.String | getVendor()
return PLATFORM_VENDOR;
| public int | hashCode()
return hashString().hashCode();
| public java.lang.String | hashString()
return String.format(PLATFORM_HASH, mApiVersionNumber);
| public boolean | isCompatibleBaseFor(IAndroidTarget target)
// basic test
if (target == this) {
return true;
}
// target is compatible wit the receiver as long as its api version number is greater or
// equal.
return target.getApiVersionNumber() >= mApiVersionNumber;
| public boolean | isPlatform()
return true;
| void | setSkins(java.lang.String[] skins)
mSkins = skins;
|
|