Skip to content

Add Chat AppFunctions sample app - #5

Merged
jbw0033 merged 2 commits into
mainfrom
chat_app_functions
Oct 29, 2026
Merged

jbw0033 merged 2 commits into
mainfrom
chat_app_functions

Conversation

@jbw0033

@jbw0033 jbw0033 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Adds the :chatappfunctions sample (phone, Wear OS, and shared modules): a chat app that exposes its features to on-device AI agents through AppFunctions.

It shows how StateStore can hold application-level state shared by the AppFunctions service and the UI. The signed-in user and the screen being shown live in a Hilt singleton StateStore. Agents change them with the changeUser and changeScreen AppFunctions, and both activities keep navigation in sync with that state.

• New module README: chatappfunctions/README.md. The root README's "Sample apps" section now lists the sample.
• Testing: ./gradlew assembleDebug test passes. All 31 :chatappfunctions:app instrumented tests pass. Verified on an Android 16+ emulator with adb shell cmd app_function execute-app-function.

Comment thread gradle/libs.versions.toml Resolved
Comment thread chatappfunctions/app/build.gradle.kts Resolved

@bsagmoe bsagmoe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you either retarget the base branch to be the github_browser one or rebase just the app functions commit on main without the github one?

@jbw0033
jbw0033 force-pushed the chat_app_functions branch from ea73619 to 2b61f71 Compare October 29, 2026 16:40
@jbw0033

jbw0033 commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Submitted it and rebased this on top of main.

jbwoods added 2 commits October 29, 2026 16:54
Adds the :chatappfunctions sample (phone, Wear OS, and shared modules):
a chat app that exposes its features to on-device AI agents through
AppFunctions, copied from the AppFunctions ChatApp sample.

The sample shows how StateStore can hold application-level state that
is shared by the AppFunctions service and the UI. The signed-in user
and the screen being shown live in a Hilt singleton StateStore, so
agents can change them with the changeUser and changeScreen
AppFunctions, and both activities keep navigation in sync with that
state.

Also adds the sample's dependencies and the android-library plugin to
the version catalog, and documents the sample in its own README and in
the "Sample apps" section of the root README.
- Update AppFunctions to 1.0.0-beta01 and integrate the upstream
  android/appfunctions ChatApp changes since the fork (service-based
  BaseChatAppFunctionService, deep-link drafts, wallpaper/search
  functions, Wear Material3 update); changeUser/changeScreen are now
  @AppFunctionDeclaration methods on the service
- Remove the app module's duplicate CallManager and RecipientsRepository
  in favor of the shared ones
- Wrap StateStore in ChatAppStateHolder with private keys instead of
  StateStore extension functions
- Wear: use rememberNavBackStack
- Pop back to the chat list before showing another screen so repeated
  changeScreen calls don't stack destinations
- Key the chat draft's rememberSaveable on recipientId
- Change applicationId (and deep-link host, app_name, README examples)
  to com.example.appstaterecipes.chatapp(.wear)
- Drop the KakaoTalk sentence from the app description
- Fix navigation sync for the new chat route and let deep links win
  over the stored screen on launch
@jbw0033
jbw0033 force-pushed the chat_app_functions branch from 2b61f71 to 2f45610 Compare October 29, 2026 16:55
@jbw0033
jbw0033 merged commit 05ed718 into main Oct 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants