Skip to content

Commit

Permalink
Merge branch 'main' into performance-class
Browse files Browse the repository at this point in the history
  • Loading branch information
SigmanZero committed Dec 11, 2024
2 parents a4c2ad6 + 67d823a commit 0ee9c2f
Show file tree
Hide file tree
Showing 46 changed files with 1,906 additions and 895 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

263 changes: 263 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Jetpack APIs used:
- [Room](https://developer.android.com/jetpack/androidx/releases/room) Persisting messages in a SQLite database
- [Window](https://developer.android.com/jetpack/androidx/releases/window) Detecting foldable device states

The app also integrates the Gemini API that powers chatbot capabilities:

- [Google AI Client SDK](https://developer.android.com/ai/google-ai-client-sdk) Generative AI with Gemini 1.5 Flash


> 🚧 **Work-in-Progress:** This sample is still in the early stage of development, and we're excited to add more features over time.
## App Overview
Expand Down Expand Up @@ -41,6 +46,16 @@ Here are the screens that make up SociaLite:
2. Open the whole project in Android Studio.
3. Sync & Run `app` configuration

> Note: The Google AI client SDK for Android used in this code sample is
recommended for prototyping only. For non-prototyping use cases, we strongly
recommend that you use [Vertex AI for Firebase](https://firebase.google.com/docs/vertex-ai/migrate-to-vertex-ai?platform=android).

### (optional) Add Gemini API:
4. Create a Gemini API key in [Google AI studio](https://aistudio.google.com/app/apikey),
5. Add your Gemini API key as `API_KEY` to your [`local.properties`] file,
6. Sync & Run `app` configuration,
7. In the app, go to Settings and tap the "AI Chatbot" button.

## Reporting Issues

You can report an [issue with a sample](https://github.com/android/socialite/issues) using
Expand Down
16 changes: 16 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ plugins {
alias(libs.plugins.hilt)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.ksp)
alias(libs.plugins.secrets)
}

kotlin {
jvmToolchain(17)
}

secrets {
defaultPropertiesFileName = "secret.defaults.properties"
}

android {
namespace = "com.google.android.samples.socialite"
compileSdk = 34
Expand Down Expand Up @@ -73,12 +78,18 @@ dependencies {
implementation(libs.camera.extensions)
implementation(libs.profileinstaller)

implementation(libs.glance.appwidget)
implementation(libs.glance.material)

testImplementation(libs.junit)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
baselineProfile(project(":baselineprofile"))

implementation(libs.glance.appwidget)
implementation(libs.glance.material)

val composeBom = platform(libs.compose.bom)
implementation(composeBom)
androidTestImplementation(composeBom)
Expand All @@ -88,6 +99,7 @@ dependencies {
implementation(libs.compose.ui.text.google.fonts)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.compose.material3)
implementation(libs.compose.material3.adaptive)
implementation(libs.compose.material.icons)
androidTestImplementation(libs.compose.ui.test)
debugImplementation(libs.compose.ui.tooling)
Expand Down Expand Up @@ -119,6 +131,7 @@ dependencies {
implementation(libs.camera2)
implementation(libs.camera.lifecycle)
implementation(libs.camera.view)
implementation(libs.camera.viewfinder.compose)

implementation(libs.media3.common)
implementation(libs.media3.effect)
Expand All @@ -139,4 +152,7 @@ dependencies {

implementation(libs.coil)
implementation(libs.coil.compose)

implementation(libs.generativeai)
implementation(libs.datastore)
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.google.android.samples.socialite.repository

import androidx.test.platform.app.InstrumentationRegistry
import com.google.android.samples.socialite.data.createTestDatabase
import com.google.android.samples.socialite.widget.model.WidgetModelRepository
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
Expand All @@ -30,6 +31,8 @@ fun createTestRepository(): ChatRepository {
contactDao = database.contactDao(),
messageDao = database.messageDao(),
notificationHelper = NotificationHelper(context),
widgetModelRepository = WidgetModelRepository(database.widgetDao(), CoroutineScope(SupervisorJob() + Dispatchers.Default), context),
coroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default),
appContext = InstrumentationRegistry.getInstrumentation().targetContext,
)
}
Loading

0 comments on commit 0ee9c2f

Please sign in to comment.