Package com.akdeniz.googleplaycrawler.GooglePlay

Examples of com.akdeniz.googleplaycrawler.GooglePlay.AppDetails


  }

  @Test(dependsOnMethods = { "shouldLogin" })
  public void shouldFetchPermissions() throws Exception {
    DetailsResponse details = service.details("com.mobulasoft.criticker");
    AppDetails appDetails = details.getDocV2().getDetails().getAppDetails();
    Assert.assertFalse(appDetails.getPermissionList().isEmpty());
  }
View Full Code Here


  @Test(dependsOnMethods = { "shouldLogin" })
  public void shouldDownload() throws Exception {
    final String packageName = "com.mobulasoft.criticker";
    DetailsResponse details = service.details(packageName);
    AppDetails appDetails = details.getDocV2().getDetails().getAppDetails();
    Offer offer = details.getDocV2().getOffer(0);

    int versionCode = appDetails.getVersionCode();
    long installationSize = appDetails.getInstallationSize();
    int offerType = offer.getOfferType();
    boolean checkoutRequired = offer.getCheckoutFlowRequired();

    // paid application...ignore
    if (checkoutRequired) {
      return;
    }

    InputStream downloadStream = service.download(appDetails.getPackageName(), versionCode, offerType);
    FileOutputStream outputStream = new FileOutputStream(File.createTempFile(packageName, ".apk"));

    byte buffer[] = new byte[1024];
    for (int k = 0; (k = downloadStream.read(buffer)) != -1;) {
      outputStream.write(buffer, 0, k);
View Full Code Here

  List<String> packages = namespace.getList("package");
  BulkDetailsResponse bulkDetails = service.bulkDetails(packages);

  for (BulkDetailsEntry bulkDetailsEntry : bulkDetails.getEntryList()) {
      DocV2 doc = bulkDetailsEntry.getDoc();
      AppDetails appDetails = doc.getDetails().getAppDetails();
      System.out.println(doc.getDocid());
      for (String permission : appDetails.getPermissionList()) {
    System.out.println("\t" + permission);
      }
  }

    }
View Full Code Here

  Integer number = namespace.getInt("number");

  SearchResponse searchResponse = service.search(query, offset, number);
  System.out.println(LIST_HEADER);
  for (DocV2 child : searchResponse.getDoc(0).getChildList()) {
      AppDetails appDetails = child.getDetails().getAppDetails();
      String formatted = new StringJoiner(DELIMETER).add(child.getTitle()).add(appDetails.getPackageName())
        .add(child.getCreator()).add(child.getOffer(0).getFormattedAmount())
        .add(String.valueOf(appDetails.getInstallationSize())).add(appDetails.getNumDownloads()).toString();
      System.out.println(formatted);

  }
    }
View Full Code Here

    System.out.println(formatted);
      }
  } else {
      System.out.println(LIST_HEADER);
      for (DocV2 child : listResponse.getDoc(0).getChildList()) {
    AppDetails appDetails = child.getDetails().getAppDetails();
    String formatted = new StringJoiner(DELIMETER).add(child.getTitle()).add(appDetails.getPackageName())
      .add(child.getCreator()).add(child.getOffer(0).getFormattedAmount())
      .add(String.valueOf(appDetails.getInstallationSize())).add(appDetails.getNumDownloads())
      .toString();
    System.out.println(formatted);

      }
  }
View Full Code Here

  return client;
    }

    private void download(String packageName) throws IOException {
  DetailsResponse details = service.details(packageName);
  AppDetails appDetails = details.getDocV2().getDetails().getAppDetails();
  Offer offer = details.getDocV2().getOffer(0);

  int versionCode = appDetails.getVersionCode();
  long installationSize = appDetails.getInstallationSize();
  int offerType = offer.getOfferType();
  boolean checkoutRequired = offer.getCheckoutFlowRequired();

  // paid application...ignore
  if (checkoutRequired) {
      System.out.println("Checkout required! Ignoring.." + appDetails.getPackageName());
      return;
  }

  System.out.println("Downloading..." + appDetails.getPackageName() + " : " + installationSize + " bytes");
  InputStream downloadStream = service.download(appDetails.getPackageName(), versionCode, offerType);

  FileOutputStream outputStream = new FileOutputStream(appDetails.getPackageName() + ".apk");

  byte buffer[] = new byte[1024];
  for (int k = 0; (k = downloadStream.read(buffer)) != -1;) {
      outputStream.write(buffer, 0, k);
  }
  downloadStream.close();
  outputStream.close();
  System.out.println("Downloaded! " + appDetails.getPackageName() + ".apk");
    }
View Full Code Here

TOP

Related Classes of com.akdeniz.googleplaycrawler.GooglePlay.AppDetails

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.