Nearby connections and multi app scenario#1
Open
MrCsabaToth wants to merge 77 commits intodevelopfrom
Open
Conversation
This commit adds the ability for multiple app instances to communicate with each other using the Android Nearby Connection API. The key features are: - A new `NearbyConnectionsManager` class to handle the Nearby Connections API. - Integration of the `NearbyConnectionsManager` with the `LlmChatViewModel`. - A new UI for selecting the role of the app (commander or subordinate). - A new UI for the nearby chat, including a checkbox for sending common messages. - The ability to display the author of the message.
This commit adds the logic to handle the commander disconnection scenario. If the commander disconnects, the subordinates will wait for a short grace period and then elect a new commander. This improves the robustness of the multi-app communication.
This commit adds the logic for the original commander to reclaim its role if it comes back online. If the original commander comes back online, the subordinates will reconnect to it, and the temporary commander will become a subordinate again. This further improves the robustness of the multi-app communication.
This commit adds the following features: - A role selector on the role selection screen to allow you to choose between being the commander or an agent (1-5). - System prompts for the commander and the agents. - A local database using ObjectBox to store the system prompts. - Integration of the system prompts with the `LlmChatViewModel`.
This commit adds the following features: - A `CryptoManager` class to handle key generation, signing, and verification. - Integration of the `CryptoManager` with the `NearbyConnectionsManager`. - Message signing and verification for all messages sent over the nearby communication API. - A warning message is displayed in the chat window if the signature of a message is invalid.
This commit adds the logic to verify that the claimed role in the message matches the cryptographic key used for signing the message. If the identity of the sender does not match the signature, the message will be discarded, and a warning message will be displayed in the chat window.
This commit adds the following features: - A mechanism to detect when two participants claim to be the same agent or the commander at the same time. - A warning message is displayed in the chat window when an impersonation is detected. - The system prompts are updated to include information about the possibility of impersonation and how to handle it.
This commit adds the following features: - Mission descriptions for each agent in markdown format. - The mission description is displayed when an agent is selected. - A vector database using ObjectBox to store the mission descriptions. - The mission descriptions are chunked and indexed into the vector database.
This commit adds the following features: - A single chat room screen for all chat functionality. - A recipient field to each message to specify who the message is for. - The local model is only fed messages that are meant for everyone or for me.
This reverts commit ca0e02b.
…xecution failed for task ':app:mergeDebugNativeLibs'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not find io.objectbox:objectbox-vector:4.3.0."
There are still compilation errors
… to get objectbox compile)
…xml: Android/src/app/src/main/AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported, and the value is ignored. Recommendation: remove package="com.google.ai.edge.gallery" from the source AndroidManifest.xml: Android/src/app/src/main/AndroidManifest.xml.
… more FAWs (Full Android Watch)
…ge version 2.0+ in kapt is in Alpha and must be enabled explicitly. Falling back to 1.9. Result: w: K2 kapt is in Alpha. Use with caution.
APK app-debug.apk is not compatible with 16 KB devices. Some libraries have LOAD segments not aligned at 16 KB boundaries: lib/arm64-v8a/libmediapipe_tasks_text_jni.so lib/arm64-v8a/libmediapipe_tasks_vision_image_generator_jni.so Starting November 1st, 2025, all new apps and updates to existing apps submitted to Google Play and targeting Android 15+ devices must support 16 KB page sizes. For more information about compatibility with 16 KB devices, visit developer.android.com/16kb-page-size.
… local file (by Gemini CLI)
…allback is not enabled for the application. Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add multi-app communication using Nearby Connections
This commit adds the ability for multiple app instances to communicate with each other using the Android Nearby Connection API.
The key features are:
NearbyConnectionsManagerclass to handle the Nearby Connections API.NearbyConnectionsManagerwith theLlmChatViewModel.feat: Add commander failover logic
This commit adds the logic to handle the commander disconnection scenario.
If the commander disconnects, the subordinates will wait for a short grace period and then elect a new commander. This improves the robustness of the multi-app communication.
feat: Add commander reclaim logic
This commit adds the logic for the original commander to reclaim its role if it comes back online.
If the original commander comes back online, the subordinates will reconnect to it, and the temporary commander will become a subordinate again. This further improves the robustness of the multi-app communication.
feat: Add system prompts and local database
This commit adds the following features:
LlmChatViewModel.feat: Add message signing and verification
This commit adds the following features:
CryptoManagerclass to handle key generation, signing, and verification.CryptoManagerwith theNearbyConnectionsManager.feat: Add identity verification
This commit adds the logic to verify that the claimed role in the message matches the cryptographic key used for signing the message.
If the identity of the sender does not match the signature, the message will be discarded, and a warning message will be displayed in the chat window.
feat: Add impersonation detection
This commit adds the following features:
feat: Add mission descriptions and vector database
This commit adds the following features:
feat: Unify chat experience and improve communication protocol
This commit adds the following features: