{"id":13628190,"url":"https://github.com/GetStream/gemini-android","last_synced_at":"2025-10-31T14:30:28.883Z","repository":{"id":218620430,"uuid":"746933651","full_name":"skydoves/gemini-android","owner":"skydoves","description":"✨ Gemini Android demonstrates Google's Generative AI on Android with Stream Chat SDK for Compose.","archived":false,"fork":false,"pushed_at":"2025-01-29T18:39:00.000Z","size":26921,"stargazers_count":365,"open_issues_count":12,"forks_count":32,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-09T21:03:56.838Z","etag":null,"topics":["android","architecture","gemini","generative-ai","jetpack","jetpack-compose","kotlin","skydoves"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/skydoves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"skydoves","custom":["https://www.paypal.me/skydoves","https://www.buymeacoffee.com/skydoves"]}},"created_at":"2024-01-22T23:43:50.000Z","updated_at":"2025-01-31T11:39:45.000Z","dependencies_parsed_at":"2024-03-28T14:43:53.220Z","dependency_job_id":"070ab397-8ae8-466d-9ba0-fb7566c39fc1","html_url":"https://github.com/skydoves/gemini-android","commit_stats":{"total_commits":105,"total_committers":3,"mean_commits":35.0,"dds":"0.22857142857142854","last_synced_commit":"30588637bced5bf11c22c01abdc5fa6ce963fbcd"},"previous_names":["skydoves/gemini-android"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2Fgemini-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2Fgemini-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2Fgemini-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2Fgemini-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skydoves","download_url":"https://codeload.github.com/skydoves/gemini-android/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239198025,"owners_count":19598502,"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":["android","architecture","gemini","generative-ai","jetpack","jetpack-compose","kotlin","skydoves"],"created_at":"2024-08-01T22:00:48.021Z","updated_at":"2025-10-31T14:30:28.821Z","avatar_url":"https://github.com/skydoves.png","language":"Kotlin","readme":"\n![Gemini Cover](https://github.com/skydoves/gemini-android/assets/24237865/bf8e6cc9-3729-49f8-8f50-b45d6649668f)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://android-arsenal.com/api?level=21\"\u003e\u003cimg alt=\"API\" src=\"https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/skydoves/gemini-android/actions/workflows/android.yml\"\u003e\u003cimg alt=\"Build Status\" src=\"https://github.com/skydoves/gemini-android/actions/workflows/android.yml/badge.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/skydoves\"\u003e\u003cimg alt=\"Profile\" src=\"https://skydoves.github.io/badges/skydoves.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**Gemini Android** demonstrates [Google's Generative AI](https://android-developers.googleblog.com/2023/12/leverage-generative-ai-in-your-android-apps.html) on Android with [Stream Chat SDK for Compose](https://getstream.io/tutorials/android-chat?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss).\n\nThe purpose of this repository is to demonstrate below:\n\n- Demonstrates [Gemini API](https://ai.google.dev/tutorials/android_quickstart) for Android.\n- Implementing entire UI elements with Jetpack Compose.\n- Implementation of Android architecture components with Jetpack libraries such as Hilt and AppStartup.\n- Performing background tasks with Kotlin Coroutines.\n- Integrating chat systems with [Stream Chat Compose SDK](https://getstream.io/tutorials/android-chat?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss) for real-time event handling.\n\n## 📷 Previews\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"previews/preview0.png\" alt=\"drawing\" width=\"270px\" /\u003e\n\u003cimg src=\"previews/preview1.png\" alt=\"drawing\" width=\"270px\" /\u003e\n\u003cimg src=\"previews/preview2.gif\" alt=\"drawing\" width=\"269px\" /\u003e\u003c/br\u003e\n\u003c/p\u003e\n\n## ✍️ Technical Content\n\nIf you're interested in the overall architecture, each layer, Generative AI, Gemini SDK, and implementation details of this project, check out the following blog post: **[Build an AI Chat Android App With Google’s Generative AI](https://getstream.io/blog/android-generative-ai/)**\n\n\u003ca href=\"https://getstream.io/chat/sdk/compose?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOs\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24237865/138428440-b92e5fb7-89f8-41aa-96b1-71a5486c5849.png\" align=\"right\" width=\"12%\"/\u003e\n\u003c/a\u003e\n\n## 🛥 Stream Chat \u0026 Video SDK\n\n**Gemini Android** is built with __[Stream Chat SDK for Compose](https://getstream.io/chat/sdk/compose?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)__ to implement messaging systems. If you’re interested in building powerful real-time video/audio calling, audio room, and livestreaming, check out the __[Stream Video SDK for Compose](https://getstream.io/video/docs/android/tutorials/video-calling?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)__!\n\n### Stream Chat\n\n- [Stream Chat SDK for Android on GitHub](https://github.com/getStream/stream-chat-android)\n- [Android Samples for Stream Chat SDK on GitHub](https://github.com/getStream/android-samples)\n- [Stream Chat Compose UI Components Guidelines](https://getstream.io/chat/docs/sdk/android/compose/overview/)\n\n### Stream Video\n\n- [Stream Video SDK for Android on GitHub](https://github.com/getstream/stream-video-android?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)\n- [Video Call Tutorial](https://getstream.io/video/docs/android/tutorials/video-calling?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)\n- [Audio Room Tutorial](https://getstream.io/video/docs/android/tutorials/audio-room?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)\n- [Livestream Tutorial](https://getstream.io/video/docs/android/tutorials/livestream?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)\n\n## 💻 How to build the project?\n\nTo build this project properly, you should follow the instructions below: \n\n1. Go to the __[Stream login page](https://getstream.io/try-for-free?utm_source=Github?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)__.\n2. If you have your GitHub account, click the **SIGN UP WITH GITHUB** button and you can sign up within a couple of seconds. \n\n![stream](figures/stream0.png)\n\n3. If you don't have a GitHub account, fill in the inputs and click the **START FREE TRIAL** button.\n4. Go to the __[Dashboard](https://dashboard.getstream.io?utm_source=Github?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)__ and click the **Create App** button like the below.\n\n![stream](figures/stream1.png)\n\n5. Fill in the blanks like the below and click the **Create App** button.\n\n\u003cimg width=\"44%\" src = \"figures/stream2.png\"\u003e\n\n6. You will see the **Key** like the image below and then copy it.\n\n![stream](figures/stream3.png)\n\n7. Create a new file named **secrets.properties** on the root directory of this Android project, and add the key to the `secrets.properties` file like the below:\n\n![stream](figures/stream5.png)\n\n```gradle\nSTREAM_API_KEY=..\n```\n\n8. Go to your __[Dashboard](https://dashboard.getstream.io?utm_source=Github?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss)__ again and click your App.\n\n9. In the **Overview** menu, you can find the **Authentication** category by scrolling to the middle of the page.\n\n10. Switch on the **Disable Auth Checks** option and click the **Submit** button like the image below.\n\n![stream](figures/stream4.png)\n\n11. Click the **Explorer** tab on the left side menu.\n\n12. Click **users** -\u003e **Create New User** button sequentially and add fill in the user like the below:\n\n\u003cimg width=\"48%\" src = \"figures/stream6.png\"\u003e\n\n- User Name: `gemini`\n- User ID: `gemini`\n\n13. Go to **[Google AI Studio](https://makersuite.google.com/app/apikey)**, login with your Google account and select the **Get API key** on the menu left like the image below:\n\n![gemini](figures/gemini0.png)\n\n14. Create your API key for using generative AI SDKs, and you'll get one like the image below:\n\n![gemini](figures/gemini1.png)\n\n15. Add the key to the `secrets.properties` file like the below:\n\n![gemini](figures/gemini2.png)\n\n```gradle\nGEMINI_API_KEY=..\n```\n\n16. Build and run the project.\n\n\n## 🛠 Tech Stack \u0026 Open Source Libraries\n- Minimum SDK level 21.\n- 100% [Jetpack Compose](https://developer.android.com/jetpack/compose) based + [Coroutines](https://github.com/Kotlin/kotlinx.coroutines) + [Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/) for asynchronous.\n- [Compose Chat SDK for Messaging](https://getstream.io/chat/sdk/compose?utm_source=Github?utm_source=Github\u0026utm_medium=Jaewoong_OSS\u0026utm_content=Developer\u0026utm_campaign=Github_Dec2024_Jaewoong_Gemini\u0026utm_term=DevRelOss): The Jetpack Compose Chat Messaging SDK is built on a low-level chat client and provides modular, customizable Compose UI components that you can easily drop into your app.\n- Jetpack\n  - Compose: Android’s modern toolkit for building native UI.\n  - ViewModel: UI related data holder and lifecycle aware.\n  - App Startup: Provides a straightforward, performant way to initialize components at application startup.\n  - Navigation: For navigating screens and [Hilt Navigation Compose](https://developer.android.com/jetpack/compose/libraries#hilt) for injecting dependencies.\n  - Room: Constructs Database by providing an abstraction layer over SQLite to allow fluent database access.\n  - Datastore: Store data asynchronously, consistently, and transactionally, overcoming some of the drawbacks of SharedPreferences.\n  - [Hilt](https://dagger.dev/hilt/): Dependency Injection.\n- [Landscapist Glide](https://github.com/skydoves/landscapist#glide), [animation](https://github.com/skydoves/landscapist#animation), [placeholder](https://github.com/skydoves/landscapist#placeholder): Jetpack Compose image loading library that fetches and displays network images with Glide, Coil, and Fresco.\n- [Retrofit2 \u0026 OkHttp3](https://github.com/square/retrofit): Construct the REST APIs and paging network data.\n- [Sandwich](https://github.com/skydoves/Sandwich): Construct a lightweight and modern response interface to handle network payload for Android.\n- [Moshi](https://github.com/square/moshi/): A modern JSON library for Kotlin and Java.\n- [ksp](https://github.com/google/ksp): Kotlin Symbol Processing API.\n- [Balloon](https://github.com/skydoves/balloon): Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android.\n- [StreamLog](https://github.com/GetStream/stream-log): A lightweight and extensible logger library for Kotlin and Android.\n- Baseline Profiles: To improve app performance by including a list of classes and methods specifications in your APK that can be used by Android Runtime.\n\n## 🏛️ Architecture\n\n**Gemini Android** follows the [Google's official architecture guidance](https://developer.android.com/topic/architecture).\n\n![architecture](figures/figure0.png)\n\n**Gemini Android** was built with [Guide to app architecture](https://developer.android.com/topic/architecture), so it would be a great sample to show how the architecture works in real-world projects.\u003cbr\u003e\n\nThe overall architecture is composed of two layers; UI Layer and the data layer. Each layer has dedicated components and they each have different responsibilities.\nThe arrow means the component has a dependency on the target component following its direction.\n\n### Architecture Overview\n\n![layer](figures/figure1.png)\n\nEach layer has different responsibilities below. Basically, they follow [unidirectional event/data flow](https://developer.android.com/topic/architecture/ui-layer#udf).\n\n### UI Layer\n\n![layer](figures/figure2.png)\n\nThe UI Layer consists of UI elements like buttons, menus, tabs that could interact with users and [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) that holds app states and restores data when configuration changes.\n\n### Data Layer\n\n![layer](figures/figure3.png)\n\nThe data Layer consists of repositories, which include business logic, such as querying data from the local database and requesting remote data from the network. It is implemented as an offline-first source of business logic and follows the [single source of truth](https://en.wikipedia.org/wiki/Single_source_of_truth) principle.\u003cbr\u003e\n\nFor more information about the overall architecture, check out **[Build a Real-Time WhatsApp Clone With Jetpack Compose](https://getstream.io/blog/build-whatsapp-clone/)**.\n\n## Modularization\n\n![02](https://github.com/skydoves/gemini-android/assets/24237865/7b0cc635-83b0-434c-b151-d0e0e0a2ff9b)\n\n**Gemini Android** has implemented the following modularization strategies:\n\n- **Reusability**: By effectively modularizing reusable code, it not only facilitates code sharing but also restricts code access across different modules.\n\n- **Parallel Building**: Modules are capable of being built in parallel, leading to reduced overall build time.\n\n- **Decentralized Focusing**: Individual development teams are allocated specific modules, allowing them to concentrate on their designated areas.\n\n\n## 💯 MAD Score\n\n![summary](https://user-images.githubusercontent.com/24237865/158918011-bc766482-ec83-47dd-9237-d8a226cab263.png)\n\n## 🤝 Contribution\n\nMost of the features are not completed except the chat feature, so anyone can contribute and improve this project following the [Contributing Guideline](https://github.com/skydoves/gemini-android/blob/main/CONTRIBUTING.md).\n\n## Find this repository useful? 💙\nSupport it by joining __[stargazers](https://github.com/skydoves/gemini-android/stargazers)__ for this repository. :star: \u003cbr\u003e\nAlso, __[follow me](https://github.com/skydoves)__ on GitHub for my next creations! 🤩\n\n# License\n```xml\nDesigned and developed by 2024 skydoves (Jaewoong Eum)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the 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,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":["https://github.com/sponsors/skydoves","https://www.paypal.me/skydoves","https://www.buymeacoffee.com/skydoves"],"categories":["GitHub projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGetStream%2Fgemini-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGetStream%2Fgemini-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGetStream%2Fgemini-android/lists"}