Esempio n. 1
0
File: Main.java Progetto: MIPS/sdk
  /** Displays the list of available Targets (Platforms and Add-ons) */
  private void displayTargetList() {
    mSdkLog.printf("Available Android targets:\n");

    int index = 1;
    for (IAndroidTarget target : mSdkManager.getTargets()) {
      mSdkLog.printf("id: %1$d or \"%2$s\"\n", index, target.hashString());
      mSdkLog.printf("     Name: %s\n", target.getName());
      if (target.isPlatform()) {
        mSdkLog.printf("     Type: Platform\n");
        mSdkLog.printf("     API level: %s\n", target.getVersion().getApiString());
        mSdkLog.printf("     Revision: %d\n", target.getRevision());
      } else {
        mSdkLog.printf("     Type: Add-On\n");
        mSdkLog.printf("     Vendor: %s\n", target.getVendor());
        mSdkLog.printf("     Revision: %d\n", target.getRevision());
        if (target.getDescription() != null) {
          mSdkLog.printf("     Description: %s\n", target.getDescription());
        }
        mSdkLog.printf(
            "     Based on Android %s (API level %s)\n",
            target.getVersionName(), target.getVersion().getApiString());

        // display the optional libraries.
        IOptionalLibrary[] libraries = target.getOptionalLibraries();
        if (libraries != null) {
          mSdkLog.printf("     Libraries:\n");
          for (IOptionalLibrary library : libraries) {
            mSdkLog.printf("      * %1$s (%2$s)\n", library.getName(), library.getJarName());
            mSdkLog.printf(String.format("          %1$s\n", library.getDescription()));
          }
        }
      }

      // get the target skins
      displaySkinList(target, "     Skins: ");

      if (target.getUsbVendorId() != IAndroidTarget.NO_USB_ID) {
        mSdkLog.printf(
            "     Adds USB support for devices (Vendor: 0x%04X)\n", target.getUsbVendorId());
      }

      index++;
    }
  }
Esempio n. 2
0
File: Main.java Progetto: MIPS/sdk
  /**
   * Displays the list of available AVDs for the given AvdManager.
   *
   * @param avdManager
   */
  public void displayAvdList(AvdManager avdManager) {
    mSdkLog.printf("Available Android Virtual Devices:\n");

    AvdInfo[] avds = avdManager.getValidAvds();
    for (int index = 0; index < avds.length; index++) {
      AvdInfo info = avds[index];
      if (index > 0) {
        mSdkLog.printf("---------\n");
      }
      mSdkLog.printf("    Name: %s\n", info.getName());
      mSdkLog.printf("    Path: %s\n", info.getPath());

      // get the target of the AVD
      IAndroidTarget target = info.getTarget();
      if (target.isPlatform()) {
        mSdkLog.printf(
            "  Target: %s (API level %s)\n", target.getName(), target.getVersion().getApiString());
      } else {
        mSdkLog.printf("  Target: %s (%s)\n", target.getName(), target.getVendor());
        mSdkLog.printf(
            "          Based on Android %s (API level %s)\n",
            target.getVersionName(), target.getVersion().getApiString());
      }

      // display some extra values.
      Map<String, String> properties = info.getProperties();
      if (properties != null) {
        String skin = properties.get(AvdManager.AVD_INI_SKIN_NAME);
        if (skin != null) {
          mSdkLog.printf("    Skin: %s\n", skin);
        }
        String sdcard = properties.get(AvdManager.AVD_INI_SDCARD_SIZE);
        if (sdcard == null) {
          sdcard = properties.get(AvdManager.AVD_INI_SDCARD_PATH);
        }
        if (sdcard != null) {
          mSdkLog.printf("  Sdcard: %s\n", sdcard);
        }
        String snapshot = properties.get(AvdManager.AVD_INI_SNAPSHOT_PRESENT);
        if (snapshot != null) {
          mSdkLog.printf("Snapshot: %s\n", snapshot);
        }
      }
    }

    // Are there some unused AVDs?
    AvdInfo[] badAvds = avdManager.getBrokenAvds();

    if (badAvds.length == 0) {
      return;
    }

    mSdkLog.printf("\nThe following Android Virtual Devices could not be loaded:\n");
    boolean needSeparator = false;
    for (AvdInfo info : badAvds) {
      if (needSeparator) {
        mSdkLog.printf("---------\n");
      }
      mSdkLog.printf("    Name: %s\n", info.getName() == null ? "--" : info.getName());
      mSdkLog.printf("    Path: %s\n", info.getPath() == null ? "--" : info.getPath());

      String error = info.getErrorMessage();
      mSdkLog.printf("   Error: %s\n", error == null ? "Uknown error" : error);
      needSeparator = true;
    }
  }
 @Override
 public String getVersionName() {
   return myWrapee.getVersionName();
 }