This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager | |
val framesPerBuffer = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER).toLong() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager | |
val outputSampleRate = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE).toLong() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apklistings apklistings = edits.apklistings(); | |
ApkListing whatsnew = new ApkListing().setRecentChanges(whatsNewDescription); | |
apklistings.update(PACKAGE, transactionId, versionCode, language, whatsnew).execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tracks tracks = edits.tracks(); | |
List<Integer> versions = Collections.singletonList(versionCode); | |
Track track = new Track().setVersionCodes(versions); | |
tracks.update(PACKAGE, transactionId, trackId, track).execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String APK_MIME_TYPE = "application/vnd.android.package-archive"; | |
... | |
Edits edits = publisher.edits(); | |
Apks apks = edits.apks(); | |
File apkFile = new File(APP_APK_PATH); // File pointing to the new APK to be uploaded | |
FileContent apkContent = new FileContent(APK_MIME_TYPE, apkFile); | |
Apk apk = apks.upload(PACKAGE, transactionId, apkContent).execute(); | |
int versionCode = apk.getVersionCode(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AndroidPublisher publisher = ... | |
Edits edits = publisher.edits(); | |
// insert, get, delete | |
AppEdit appEdit = edits.insert(PACKAGE, null).execute(); | |
String transactionId = appEdit.getId(); | |
... | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NetHttpTransport http = GoogleNetHttpTransport.newTrustedTransport(); | |
JacksonFactory json = JacksonFactory.getDefaultInstance(); | |
GoogleCredential credential = ... | |
AndroidPublisher publisher = new AndroidPublisher.Builder(http, json, credential). | |
setApplicationName(PACKAGE). | |
build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NetHttpTransport http = GoogleNetHttpTransport.newTrustedTransport(); | |
JacksonFactory json = JacksonFactory.getDefaultInstance(); | |
Set<String> scopes = Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER); | |
File secretFile = new File(Constants.SECRET_FILE_PATH); | |
GoogleCredential credential = new GoogleCredential.Builder(). | |
setTransport(http). | |
setJsonFactory(json). | |
setServiceAccountPrivateKeyId(Constants.KEY_ID). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'com.google.apis:google-api-services-androidpublisher:v2-rev24-1.21.0' |