Skip to content

Instantly share code, notes, and snippets.

@julioz
Created April 27, 2016 02:19
Show Gist options
  • Save julioz/49ead7afabb3cff3f46f812e4e5aa67d to your computer and use it in GitHub Desktop.
Save julioz/49ead7afabb3cff3f46f812e4e5aa67d to your computer and use it in GitHub Desktop.
Rotina de atualização de um app
Edits edits = publisher.edits();
Apks apks = edits.apks();
File apkFile = new File(APP_APK_PATH);
FileContent apkContent = new FileContent(APK_MIME_TYPE, apkFile);
Apk apk = apks.upload(PACKAGE, transactionId, apkContent).execute();
int versionCode = apk.getVersionCode();
Tracks tracks = edits.tracks();
List<Integer> versions = Collections.singletonList(versionCode);
Track track = new Track().setVersionCodes(versions);
tracks.update(PACKAGE, transactionId, trackId, track).execute();
Apklistings apklistings = edits.apklistings();
ApkListing whatsnew = new ApkListing().setRecentChanges(whatsNewDescription);
apklistings.update(PACKAGE, transactionId, versionCode, language, whatsnew).execute();
edits.validate(PACKAGE, transactionId).execute();
edits.commit(PACKAGE, transactionId).execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment