本文整理汇总了Java中com.android.sdklib.AndroidVersion.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java AndroidVersion.DEFAULT属性的具体用法?Java AndroidVersion.DEFAULT怎么用?Java AndroidVersion.DEFAULT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.sdklib.AndroidVersion
的用法示例。
在下文中一共展示了AndroidVersion.DEFAULT属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLatestVersion
@Nullable
public GradleCoordinate getLatestVersion(String artifact) {
int compileVersion = GradleImport.CURRENT_COMPILE_VERSION;
AndroidVersion version = getCompileSdkVersion();
if (version != AndroidVersion.DEFAULT) {
compileVersion = version.getFeatureLevel();
}
// If you're using for example android-14, you still need support libraries
// from version 18 (earliest version where we have all the libs in the m2 repository)
if (compileVersion < 18) {
compileVersion = 18;
}
String compileVersionString = Integer.toString(compileVersion);
if (myImporter.getSdkLocation() != null) {
@SuppressWarnings("UnnecessaryLocalVariable") String filter = compileVersionString;
GradleCoordinate max =
SdkMavenRepository.ANDROID.getHighestInstalledVersion(myImporter.getSdkLocation(), SUPPORT_GROUP_ID, artifact, filter, true);
if (max != null) {
return max;
}
}
String coordinate = SUPPORT_GROUP_ID + ':' + artifact + ':' + compileVersionString + ".+";
return GradleCoordinate.parseCoordinateString(coordinate);
}
示例2: getTargetSdkVersion
@NotNull
public static AndroidVersion getTargetSdkVersion(@Nullable Module module) {
if (module != null) {
AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet != null) {
AndroidModuleInfo moduleInfo = get(facet.getModule());
if (moduleInfo != null) {
return moduleInfo.getTargetSdkVersion();
}
}
}
return AndroidVersion.DEFAULT;
}
示例3: getMinSdkVersion
@NotNull
public static AndroidVersion getMinSdkVersion(@Nullable Module module) {
if (module != null) {
AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet != null) {
AndroidModuleInfo moduleInfo = get(facet.getModule());
if (moduleInfo != null) {
return moduleInfo.getMinSdkVersion();
}
}
}
return AndroidVersion.DEFAULT;
}
示例4: getDeviceVersion
/**
* Retrieves the version of Android running on the device by reading its system properties.
* Returns {@link com.android.sdklib.AndroidVersion#DEFAULT} if there are any issues while reading the properties.
*/
@NotNull
public static AndroidVersion getDeviceVersion(@NotNull IDevice device) {
try {
String apiLevel = device.getProperty(IDevice.PROP_BUILD_API_LEVEL);
if (apiLevel == null) {
return AndroidVersion.DEFAULT;
}
return new AndroidVersion(Integer.parseInt(apiLevel), device.getProperty(IDevice.PROP_BUILD_CODENAME));
}
catch (Exception e) {
return AndroidVersion.DEFAULT;
}
}
示例5: getVersion
@Override
public com.android.sdklib.AndroidVersion getVersion() {
return AndroidVersion.DEFAULT;
}
示例6: getTargetSdkVersion
/**
* Returns the target API level for the project
*
* @return the target API level or {@link AndroidVersion#DEFAULT} if unknown
*/
@NonNull
public AndroidVersion getTargetSdkVersion() {
return mManifestTargetSdk == AndroidVersion.DEFAULT
? getMinSdkVersion() : mManifestTargetSdk;
}
示例7: getMinSdkVersion
@NotNull
@Override
public AndroidVersion getMinSdkVersion() {
sync();
return myMinSdk != null ? myMinSdk : AndroidVersion.DEFAULT;
}
示例8: getMinSdkVersion
/**
* Returns the minimum API level for the project
*
* @return the minimum API level or {@link AndroidVersion#DEFAULT} if unknown
*/
@NonNull
public AndroidVersion getMinSdkVersion() {
return mManifestMinSdk == null ? AndroidVersion.DEFAULT : mManifestMinSdk;
}
示例9: getMinSdk
/**
* Returns the minimum API <b>level</b> requested by the manifest, or -1 if not
* specified. Use {@link #getMinSdkVersion()} to get a full version if you need
* to check if the platform is a preview platform etc.
*
* @return the minimum API level or -1 if unknown
*/
public int getMinSdk() {
AndroidVersion version = getMinSdkVersion();
return version == AndroidVersion.DEFAULT ? -1 : version.getApiLevel();
}
示例10: getTargetSdk
/**
* Returns the target API <b>level</b> specified by the manifest, or -1 if not
* specified. Use {@link #getTargetSdkVersion()} to get a full version if you need
* to check if the platform is a preview platform etc.
*
* @return the target API level or -1 if unknown
*/
public int getTargetSdk() {
AndroidVersion version = getTargetSdkVersion();
return version == AndroidVersion.DEFAULT ? -1 : version.getApiLevel();
}