当前位置: 首页>>代码示例>>Java>>正文


Java AndroidVersion.DEFAULT属性代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ImportModule.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AndroidModuleInfo.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AndroidModuleInfo.java

示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DevicePropertyUtil.java

示例5: getVersion

@Override
public com.android.sdklib.AndroidVersion getVersion() {
    return AndroidVersion.DEFAULT;
}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:4,代码来源:FileDevice.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:Project.java

示例7: getMinSdkVersion

@NotNull
@Override
public AndroidVersion getMinSdkVersion() {
  sync();
  return myMinSdk != null ? myMinSdk : AndroidVersion.DEFAULT;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:PrimaryManifestInfo.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:Project.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:Project.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:Project.java


注:本文中的com.android.sdklib.AndroidVersion.DEFAULT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。