11. Google Developer Console
Habilitar a Google Play Android Developer API *
* crie um projeto no developer console se já não houver um com APIs configuradas
* painel Visão Geral do console
https://console.developers.google.com/apis
12. Google Developer Console
Obtendo a service account key
* painel Credenciais do console
https://console.developers.google.com/apis
20. Google Play Developer API *
● Subscriptions and In-App Purchases API
○ In-App Products
○ Status de produtos comprados
○ Produtos recorrentes e subscriptions
● Publishing API
○ Criação e modificação dos Listings de seu app
○ Upload de novas versões do APK
○ Atribuição de APKs às Tracks do Google Play (alpha, beta, staged rollout e produção)
* Limite de 200 mil requisições por dia
28. Configurando a dependência
AppEdits - validate e commit
AndroidPublisher publisher = ...
Edits edits = publisher.edits();
// insert, get, delete
AppEdit appEdit = edits.insert(PACKAGE, null).execute();
String transactionId = appEdit.getId();
...
...
edits.validate(PACKAGE, transactionId).execute();
edits.commit(PACKAGE, transactionId).execute();
https://developers.google.com/android-publisher/#publishing
{
"code" : 403,
"errors" : [
{
"domain" : "androidpublisher",
"message" : "The full description for the app
is too long for language en-US.",
"reason" : "fullDescriptionTooLong"
}
],
"message" : "The full description for the app is too
long for language en-US."
}
29. Configurando a dependência
AppEdits - Listings
Edits edits = publisher.edits();
Listings listings = edits.listings();
ListingsListResponse listingsListResponse = listings.list(PACKAGE, transactionId).execute();
// Selecionar o Listing que vai ser atualizado
Listing listing = listingsListResponse.getListings().get(...)
listing.setFullDescription(description);
listings.update(PACKAGE, transactionId, language, listing).execute();
// ... validate
// ... commit
https://developers.google.com/android-publisher/#publishing
30. Configurando a dependência
AppEdits - Listings
Edits edits = publisher.edits();
Listings listings = edits.listings();
ListingsListResponse listingsListResponse = listings.list(PACKAGE, transactionId).execute();
// Selecionar o Listing que vai ser atualizado
Listing listing = listingsListResponse.getListings().get(...)
listing.setFullDescription(description);
listings.update(PACKAGE, transactionId, language, listing).execute();
// ... validate
// ... commit
https://developers.google.com/android-publisher/#publishing
{
"fullDescription" : "This app is a simple demo
application for developers who
are interested in continuous
deploy in the android platform.",
"language" : "en-US",
"shortDescription" : "Demo application for
developers",
"title" : "Continuous Deploy Demo App",
"video" : ""
}
31. Configurando a dependência
AppEdits - upload do APK
Apks apks = edits.apks();
FileContent apkContent = new FileContent(APK_MIME_TYPE, apkFile);
Apk apk = apks.upload(PACKAGE, transactionId, apkContent).execute();
int version = apk.getVersionCode();
https://developers.google.com/android-publisher/#publishing
32. Configurando a dependência
AppEdits - Tracks
Apks apks = edits.apks();
FileContent apkContent = new FileContent(APK_MIME_TYPE, apkFile);
Apk apk = apks.upload(PACKAGE, transactionId, apkContent).execute();
int version = apk.getVersionCode();
Tracks tracks = edits.tracks();
List<Integer> versions = Collections.singletonList(version);
Track track = new Track().setVersionCodes(versions);
tracks.update(PACKAGE, transactionId, trackId, track).execute();
https://developers.google.com/android-publisher/#publishing