FileDocCategorySizeDatePackage
SdkConstants.javaAPI DocAndroid 1.5 API12977Wed May 06 22:41:10 BST 2009com.android.sdklib

SdkConstants

public final class SdkConstants extends Object
Constant definition class.

Most constants have a prefix defining the content.
  • OS_ OS path constant. These paths are different depending on the platform.
  • FN_ File name constant.
  • FD_ Folder name constant.

Fields Summary
public static final int
PLATFORM_UNKNOWN
public static final int
PLATFORM_LINUX
public static final int
PLATFORM_WINDOWS
public static final int
PLATFORM_DARWIN
public static final int
CURRENT_PLATFORM
Returns current platform, one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN}, {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.
public static final String
FN_ANDROID_MANIFEST_XML
An SDK Project's AndroidManifest.xml file
public static final String
FN_BUILD_XML
An SDK Project's build.xml file
public static final String
FN_FRAMEWORK_LIBRARY
Name of the framework library, i.e. "android.jar"
public static final String
FN_ATTRS_XML
Name of the layout attributes, i.e. "attrs.xml"
public static final String
FN_ATTRS_MANIFEST_XML
Name of the layout attributes, i.e. "attrs_manifest.xml"
public static final String
FN_FRAMEWORK_AIDL
framework aidl import file
public static final String
FN_LAYOUTLIB_JAR
layoutlib.jar file
public static final String
FN_WIDGETS
widget list file
public static final String
FN_INTENT_ACTIONS_ACTIVITY
Intent activity actions list file
public static final String
FN_INTENT_ACTIONS_BROADCAST
Intent broadcast actions list file
public static final String
FN_INTENT_ACTIONS_SERVICE
Intent service actions list file
public static final String
FN_INTENT_CATEGORIES
Intent category list file
public static final String
FN_BUILD_PROP
platform build property file
public static final String
FN_PLUGIN_PROP
plugin properties file
public static final String
FN_MANIFEST_INI
add-on manifest file
public static final String
FN_HARDWARE_INI
hardware properties definition file
public static final String
FN_SKIN_LAYOUT
Skin layout file
public static final String
FN_DX_JAR
dex.jar file
public static final String
FN_DX
dx executable
public static final String
FN_AAPT
aapt executable
public static final String
FN_AIDL
aidl executable
public static final String
FD_RESOURCES
Resources folder name, i.e. "res".
public static final String
FD_ASSETS
Assets folder name, i.e. "assets"
public static final String
FD_SOURCES
Default source folder name, i.e. "src"
public static final String
FD_GEN_SOURCES
Default generated source folder name, i.e. "gen"
public static final String
FD_NATIVE_LIBS
Default native library folder name inside the project, i.e. "libs" While the folder inside the .apk is "lib", we call that one libs because that's what we use in ant for both .jar and .so and we need to make the 2 development ways compatible.
public static final String
FD_APK_NATIVE_LIBS
Native lib folder inside the APK: "lib"
public static final String
FD_OUTPUT
Default output folder name, i.e. "bin"
public static final String
FD_ANIM
Default anim resource folder name, i.e. "anim"
public static final String
FD_COLOR
Default color resource folder name, i.e. "color"
public static final String
FD_DRAWABLE
Default drawable resource folder name, i.e. "drawable"
public static final String
FD_LAYOUT
Default layout resource folder name, i.e. "layout"
public static final String
FD_MENU
Default menu resource folder name, i.e. "menu"
public static final String
FD_VALUES
Default values resource folder name, i.e. "values"
public static final String
FD_XML
Default xml resource folder name, i.e. "xml"
public static final String
FD_RAW
Default raw resource folder name, i.e. "raw"
public static final String
FD_PLATFORMS
Name of the SDK platforms folder.
public static final String
FD_ADDONS
Name of the SDK addons folder.
public static final String
FD_TOOLS
Name of the SDK tools folder.
public static final String
FD_LIB
Name of the SDK tools/lib folder.
public static final String
FD_DOCS
Name of the SDK docs folder.
public static final String
FD_DOCS_REFERENCE
Name of the doc folder containing API reference doc (javadoc)
public static final String
FD_IMAGES
Name of the SDK images folder.
public static final String
FD_SKINS
Name of the SDK skins folder.
public static final String
FD_SAMPLES
Name of the SDK samples folder.
public static final String
FD_TEMPLATES
Name of the SDK templates folder, i.e. "templates"
public static final String
FD_DATA
Name of the SDK data folder, i.e. "data"
public static final String
FD_RES
Name of the SDK resources folder, i.e. "res"
public static final String
FD_FONTS
Name of the SDK font folder, i.e. "fonts"
public static final String
FD_ANDROID_SOURCES
Name of the android sources directory
public static final String
FD_ADDON_LIBS
Name of the addon libs folder.
public static final String
NS_RESOURCES
Namespace for the resource XML, i.e. "http://schemas.android.com/apk/res/android"
public static final String
OS_SDK_DOCS_FOLDER
Path of the documentation directory relative to the sdk folder. This is an OS path, ending with a separator.
public static final String
OS_SDK_TOOLS_FOLDER
Path of the tools directory relative to the sdk folder, or to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_SDK_TOOLS_LIB_FOLDER
Path of the lib directory relative to the sdk folder, or to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_IMAGES_FOLDER
Path of the images directory relative to a platform or addon folder. This is an OS path, ending with a separator.
public static final String
OS_SKINS_FOLDER
Path of the skin directory relative to a platform or addon folder. This is an OS path, ending with a separator.
public static final String
OS_PLATFORM_DATA_FOLDER
Path of the data directory relative to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_PLATFORM_SAMPLES_FOLDER
Path of the samples directory relative to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_PLATFORM_RESOURCES_FOLDER
Path of the resources directory relative to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_PLATFORM_FONTS_FOLDER
Path of the fonts directory relative to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_PLATFORM_SOURCES_FOLDER
Path of the android source directory relative to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_PLATFORM_TEMPLATES_FOLDER
Path of the android templates directory relative to a platform folder. This is an OS path, ending with a separator.
public static final String
OS_PLATFORM_ATTRS_XML
Path of the attrs.xml file relative to a platform folder.
public static final String
OS_PLATFORM_ATTRS_MANIFEST_XML
Path of the attrs_manifest.xml file relative to a platform folder.
public static final String
OS_PLATFORM_LAYOUTLIB_JAR
Path of the layoutlib.jar file relative to a platform folder.
public static final String
OS_ADDON_LIBS_FOLDER
Path of the images directory relative to a folder folder. This is an OS path, ending with a separator.
public static final String
SKIN_DEFAULT
Skin default
Constructors Summary
Methods Summary
public static java.lang.StringandroidCmdName()
Returns the appropriate name for the 'android' command, which is 'android.bat' for Windows and 'android' for all other platforms.


                        
        
        String os = System.getProperty("os.name");
        String cmd = "android";
        if (os.startsWith("Windows")) {
            cmd += ".bat";
        }
        return cmd;
    
private static intcurrentPlatform()
Returns current platform

return
one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN}, {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.

        String os = System.getProperty("os.name");          //$NON-NLS-1$
        if (os.startsWith("Mac OS")) {                      //$NON-NLS-1$
            return PLATFORM_DARWIN;
        } else if (os.startsWith("Windows")) {              //$NON-NLS-1$
            return PLATFORM_WINDOWS;
        } else if (os.startsWith("Linux")) {                //$NON-NLS-1$
            return PLATFORM_LINUX;
        }

        return PLATFORM_UNKNOWN;
    
public static java.lang.StringmkSdCardCmdName()
Returns the appropriate name for the 'mksdcard' command, which is 'mksdcard.exe' for Windows and 'mkdsdcard' for all other platforms.

        String os = System.getProperty("os.name");
        String cmd = "mksdcard";
        if (os.startsWith("Windows")) {
            cmd += ".exe";
        }
        return cmd;