Upload uploadRequest = edits
.apks()
.upload(ApplicationConfig.PACKAGE_NAME,
editId,
apkFile);
Apk apk = uploadRequest.execute();
log.info(String.format("Version code %d has been uploaded",
apk.getVersionCode()));
// Assign apk to beta track.
List<Integer> apkVersionCodes = new ArrayList<>();
apkVersionCodes.add(apk.getVersionCode());
Update updateTrackRequest = edits
.tracks()
.update(ApplicationConfig.PACKAGE_NAME,
editId,
TRACK_BETA,
new Track().setVersionCodes(apkVersionCodes));
Track updatedTrack = updateTrackRequest.execute();
log.info(String.format("Track %s has been updated.", updatedTrack.getTrack()));
// Update recent changes field in apk listing.
final ApkListing newApkListing = new ApkListing();
newApkListing.setRecentChanges(APK_LISTING_RECENT_CHANGES_TEXT);
Apklistings.Update
updateRecentChangesRequest = edits
.apklistings()
.update(ApplicationConfig.PACKAGE_NAME,
editId,
apk.getVersionCode(),
Locale.US.toString(),
newApkListing);
updateRecentChangesRequest.execute();
log.info("Recent changes has been updated.");