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
// Install GCP Client library | |
// npm install --save @google-cloud/storage | |
// To run the client library, you must first set up authentication by creating a service account | |
// and setting an environment variable. Ask your DevOps person to provide you with service account key | |
// For example: | |
// export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/[FILE_NAME].json" | |
// Imports the Google Cloud client library | |
const { Storage } = require('@google-cloud/storage'); |
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
// Declare the data class in Contact.kt | |
data class Contact( | |
val id: String, | |
val name: String, | |
val thumbnailUri: String? | |
) | |
// Following code goes into Fragment or Activity file | |
// This snippet is used in Android Fragments. Change it accordingly for using it in Activities |
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
class DemoWorker(appContext: Context, workerParams: WorkerParameters) : | |
Worker(appContext, workerParams) { | |
override fun doWork(): Result { | |
.... | |
// Synchronous Apollo request | |
val result = runBlocking { | |
try { |
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
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.UUID; | |
import okhttp3.Headers; | |
import okhttp3.MediaType; | |
import okhttp3.RequestBody; | |
import okhttp3.internal.Util; | |
import okio.Buffer; |