{"id":20082409,"url":"https://github.com/googlesamples/engage-sdk-samples","last_synced_at":"2025-05-06T00:31:50.321Z","repository":{"id":219867121,"uuid":"682871145","full_name":"googlesamples/engage-sdk-samples","owner":"googlesamples","description":"Set of sample apps that demonstrate how to integrate the SDK in your app to publish different types of content. These apps are a great way to learn how to use the SDK, to get started with the integration in your own app, as well as some best practices.","archived":false,"fork":false,"pushed_at":"2024-04-05T17:17:29.000Z","size":286,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-09T06:25:19.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developer.android.com/guide/playcore/engage","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googlesamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-25T04:18:25.000Z","updated_at":"2025-03-03T10:53:25.000Z","dependencies_parsed_at":"2024-01-30T04:31:14.668Z","dependency_job_id":"0e02b9cc-4e31-457e-bb07-84a44bc462a3","html_url":"https://github.com/googlesamples/engage-sdk-samples","commit_stats":null,"previous_names":["googlesamples/engage-sdk-samples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlesamples%2Fengage-sdk-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlesamples%2Fengage-sdk-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlesamples%2Fengage-sdk-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlesamples%2Fengage-sdk-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googlesamples","download_url":"https://codeload.github.com/googlesamples/engage-sdk-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252598432,"owners_count":21774256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T15:43:16.953Z","updated_at":"2025-05-06T00:31:49.974Z","avatar_url":"https://github.com/googlesamples.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Engage SDK Integration Samples\n============\n\nIntroduction\n------------\n\nThese sample demonstrates Engage SDK Integration with basic apps utilizing the Read and Watch verticals, the read version being written in Java while the watch version being written in Kotlin.\n\nThese sample aim to provide clear and well-documented code examples and cover varied use-cases of Engage SDK so third-party developers can learn how to integrate their existing apps cleanly and efficiently with Engage SDK.\n\nGetting started\n---------------\nClone this project to your workstation using a git client. You can use the\n[instructions from GitHub](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository)\nif you need guidance.\n\nThis project uses the Gradle build system. To build this project, use the\n`gradlew build` command or use \"Import Project\" in Android Studio.\n\nFor more resources on learning Android development, visit the\n[Developer Guides](https://developer.android.com/guide/) at\n[developer.android.com](https://developer.android.com).\n\nFor Java developers\n-------------------\n\nThe version of this sample is contained in the read/ directory. It is written fully in Java. The main focal point of the code is in the read/publish directory, containing all code involved with publishing through Engage SDK.\n\nSpecifically, EngageServiceWorker is the class in which all publishing occurs. We publish with [WorkManager](https://developer.android.com/topic/libraries/architecture/workmanager), as [recommended by Engage SDK](https://developer.android.com/guide/playcore/engage/publish#workmanager), and EngageServiceWorker is the worker which does the publishing. EngageServiceWorker extends ListenableWorker due to the asynchronous nature of the publishing calls, and we recommend your worker in your app should do the same. Note that we use one worker for publishing, passing in flags indicating which cluster to publish, but you may choose to use multiple workers depending on what fits your app architecture.\n\nThe work for EngageServiceWorker is triggered in SetEngageState.java. This is a class with methods to queue up periodic publishing when the app is closed, and one-time publishing for when a broadcast intent for publishing is received by EngageServiceBroadcastReceiver.\n\nThe other classes within the directory, such as GetContinuationCluster.java defines methods to build different clusters. These classes are useful for you to see how to build clusters, but the methods to construct entities and the content of the entities within the clusters will look very different within your app.\n\nOutside of that publish/ directory, converters/EbookToEntityConverter.java contains methods to build an Entity for publishing. This class is useful to show how to construct an entity once you have your data that it should hold.\n\nAny more specific information about these classes and the decisions made within them can be found in those classes JavaDocs and the JavaDocs for the methods in that class.\n\nFor Kotlin developers\n-------------------\n\nThe version of this sample is contained in the watch/ directory. It is written fully in Kotlin. The main focal point of the code is in the watch/publish directory, containing all code involved with publishing through Engage SDK.\n\nSpecifically, EngageServiceWorker is the class in which all publishing occurs. We publish with [WorkManager](https://developer.android.com/topic/libraries/architecture/workmanager), as [recommended by Engage SDK](https://developer.android.com/guide/playcore/engage/publish#workmanager), and EngageServiceWorker is the worker which does the publishing. EngageServiceWorker extends CoroutineWorker due to the asynchronous nature of the publishing calls, and we recommend your worker in your app should do the same. Note that we use one worker for publishing, passing in flags indicating which cluster to publish, but you may choose to use multiple workers depending on what fits your app architecture.\n\nThe work for EngageServiceWorker is triggered in Publisher.kt. This is a class with methods to queue up periodic publishing when the app is closed.\n\nClusterRequestFactory.kt defines a factory to build different publish requests, from constructing the cluster to constructing a request from said cluster. This class is useful for you to see how to build clusters and requests, but the content of the entities within the clusters will look very different within your app.\n\nOutside of that publish/ directory, data/converters/ItemToEntityConverter.kt contains methods to build an Entity for publishing. This class is useful to show how to construct an entity once you have your data that it should hold.\n\nAny more specific information about these classes and the decisions made within them can be found in those classes JavaDocs and the JavaDocs for the methods in that class.\n\nLibraries used\n--------------\n\n* [Engage SDK][0] - A library to send data locally to Google's on-device content aggregation surfaces.\n\n[0]: https://developer.android.com/guide/playcore/engage\n\nSupport\n-------\n\nPlease report issues with this sample in this project's issues page:\nhttps://github.com/googlesamples/engage-sdk-samples/issues\n\nLicense\n-------\n\n```\nCopyright 2023 Google, Inc.\n\nLicensed to the Apache Software Foundation (ASF) under one or more contributor\nlicense agreements.  See the NOTICE file distributed with this work for\nadditional information regarding copyright ownership.  The ASF licenses this\nfile to you under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License.  You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglesamples%2Fengage-sdk-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglesamples%2Fengage-sdk-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglesamples%2Fengage-sdk-samples/lists"}