android / socialite

Apache License 2.0
346 stars 60 forks source link

SociaLite: An Android Sample App

SociaLite demonstrates how to use various Android platform APIs to implement features that are commonly seen in social network apps, leveraging a variety of Jetpack APIs to achieve complex functionality that works reliably on more devices and requires less code. These are some of the Jetpack APIs used:

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

🚧 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

Screenshots of SociaLite showing the Timeline Screen, the Chat List Screen, and the Chat Screen

The main interaction in SociaLite centers around the animal avatars and their associated chat threads. When you send a message to one of these avatars, they will respond in 5 seconds. If you close the app within that time and you've granted notification permissions, you'll see a notification for that reply.

Here are the screens that make up SociaLite:

How to run SociaLite

  1. Clone the repository
  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.

(optional) Add Gemini API:

  1. Create a Gemini API key in Google AI studio,
  2. Add your Gemini API key as API_KEY to your [local.properties] file,
  3. Sync & Run app configuration,
  4. In the app, go to Settings and tap the "AI Chatbot" button.

Reporting Issues

You can report an issue with a sample using this repository. When doing so, make sure to specify which sample you are referring to.

Contributions

Please contribute! We will gladly review any pull requests. Make sure to read the Contributing page first though.

Note: make sure to run ./gradlew spotlessApply before uploading a PR.

License

Copyright 2023 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.