Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
L'SDK Engage include un insieme di app di esempio che mostrano come integrare
l'SDK nella tua app per pubblicare diversi tipi di contenuti. Queste app sono un ottimo modo per imparare a utilizzare l'SDK, iniziare a integrare l'SDK nella tua app e conoscere alcune best practice.
Le app di esempio sono disponibili nelle seguenti lingue:
Java
Kotlin
Per eseguire un'app di esempio, clona il
repository di esempi dell'SDK Engage e apri il progetto
dell'app di esempio nel tuo IDE preferito. Poi, segui le istruzioni nel
file README per compilare ed eseguire l'app.
Il repository di app di esempio include due app per dimostrare la pubblicazione di diversi tipi di contenuti:
Quando esamini questa app di esempio, tieni presente quanto segue:
L'app è scritta interamente in Java.
Il punto focale principale del codice si trova nella directory read/publish, che contiene tutto il codice necessario per la pubblicazione tramite l'SDK Engage.
L'app dimostra l'utilizzo di WorkManager come consigliato nella documentazione dell'API Engage e EngageServiceWorker è il worker che esegue la pubblicazione.
EbookToEntityConverter contiene metodi per
costruire un'entità per la pubblicazione. Questo corso è utile per mostrare come creare un'entità dai dati esistenti nella tua applicazione.
Quando esamini questa app di esempio, tieni presente quanto segue:
L'app è scritta interamente in Kotlin.
Il punto focale principale del codice si trova nella directory watch/publish, che contiene tutto il codice necessario per la pubblicazione tramite l'SDK Engage.
L'app dimostra l'utilizzo di WorkManager come consigliato nella documentazione dell'API Engage e EngageServiceWorker è il worker che esegue la pubblicazione.
ItemToEntityConverter contiene metodi per
costruire un'entità per la pubblicazione. Questo corso è utile per mostrare come costruire un'entità dai dati esistenti nella tua applicazione.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# Engage SDK Sample Apps\n\nThe Engage SDK includes a set of sample apps that demonstrate how to integrate\nthe SDK in your app to publish different types of content. These apps are a\ngreat way to learn how to use the SDK, to get started with the integration in\nyour own app, as well as some best practices.\n\nThe [sample apps](https://github.com/googlesamples/engage-sdk-samples) are available in the following\nlanguages:\n\n- Java\n- Kotlin\n\nTo run a sample app, clone the\n[Engage SDK Samples repository](https://github.com/googlesamples/engage-sdk-samples) and open the sample\napp project in your preferred IDE. Then, follow the instructions in the\nREADME file to build and run the app.\n\nThe sample apps repository includes two apps to demonstrate publishing different\ntypes of content:\n\n- [Read Sample App](#read-sample-app)\n- [Watch Sample App](#watch-sample-app)\n\nRead Sample App\n---------------\n\nThis sample app demonstrates how to integrate 'reading' content using the Engage\nSDK APIs. The app includes the usage of different APIs mentioned in the\n[Engage SDK Read: Third-party technical integration instructions](/guide/playcore/engage/read)\n\nWhen reviewing this sample app, consider the following:\n\n- The app is written entirely in Java.\n- The main focal point of the code is in the [read/publish](https://github.com/googlesamples/engage-sdk-samples/tree/main/read/app/src/main/java/com/google/samples/quickstart/engagesdksamples/read/publish) directory, containing all code necessary to publish through the Engage SDK.\n- The app demonstrates the use of WorkManager as recommended in the Engage API docs, and [EngageServiceWorker](https://github.com/googlesamples/engage-sdk-samples/blob/main/read/app/src/main/java/com/google/samples/quickstart/engagesdksamples/read/publish/EngageServiceWorker.java) is the worker which does the publishing.\n- [EbookToEntityConverter](https://github.com/googlesamples/engage-sdk-samples/blob/main/read/app/src/main/java/com/google/samples/quickstart/engagesdksamples/read/converters/EbookToEntityConverter.java) contains methods to build an Entity for publishing. This class is useful to show how to construct an entity from the data that already exists in your application.\n\n| **Note:** The sample app uses one worker for publishing, passing in flags indicating which cluster to publish. Depending on your app architecture, you might choose to use multiple workers.\n\n[Link to Engage SDK Read Sample App on Github](https://github.com/googlesamples/engage-sdk-samples/tree/main/read)\n\nWatch Sample App\n----------------\n\nThis sample app demonstrates how to integrate video content using the Engage SDK\nAPIs. The app includes the usage of different APIs mentioned in the\n[Engage SDK Watch: Third-party technical integration instructions](/guide/playcore/engage/watch)\n\nWhen reviewing this sample app, consider the following:\n\n- The app is written entirely in Kotlin.\n- The main focal point of the code is in the [watch/publish](https://github.com/googlesamples/engage-sdk-samples/tree/main/watch/app/src/main/java/com/google/samples/quickstart/engagesdksamples/watch/publish) directory, containing all code necessary to publish through the Engage SDK.\n- The app demonstrates the use of WorkManager as recommended in the Engage API docs, and [EngageServiceWorker](https://github.com/googlesamples/engage-sdk-samples/blob/main/watch/app/src/main/java/com/google/samples/quickstart/engagesdksamples/watch/publish/EngageServiceWorker.kt) is the worker which does the publishing.\n- [ItemToEntityConverter](https://github.com/googlesamples/engage-sdk-samples/blob/main/watch/app/src/main/java/com/google/samples/quickstart/engagesdksamples/watch/data/converters/ItemToEntityConverter.kt) contains methods to build an Entity for publishing. This class is useful to show how to construct an entity from the data that already exists in your application.\n\n| **Note:** The sample app uses one worker for publishing, passing in flags indicating which cluster to publish. Depending on your app architecture, you might choose to use multiple workers.\n\n[Link to Engage SDK Watch Sample App on Github](https://github.com/googlesamples/engage-sdk-samples/tree/main/watch)\n\nAdditional Tips\n---------------\n\nHere are some additional tips for using the Engage SDK sample apps:\n\n- Use the sample apps to understand how to call specific Engage SDK APIs in your app.\n- Experiment with different features of the Engage SDK.\n\nSupport\n-------\n\nContact [engage-developers@google.com](mailto:engage-developers@google.com)\nif you have any questions that are not covered here."]]