Skip to content

Repository files navigation

💬 Java Android Messenger

Java Android Messenger (app name: Social Chat) is an AI-powered chat app for Android, built with Java. Every message you send is forwarded to Google's Gemini API, and the reply is shown as a chat bubble — with the full conversation history persisted locally in a SQLite database.

Java Android SQLite Gemini API License

✨ Features

Gemini AI replies: Every message is sent to Google's Gemini API and answered in real time. ✅ Persistent history: All messages are stored locally in a SQLite database and reloaded on launch. ✅ Chat-style UI: User and bot messages are rendered as distinct, rounded message bubbles. ✅ Clear conversation: Wipe the entire chat history with a single confirmation dialog. ✅ Smooth animations: Input field and send button use subtle scale/overshoot animations, and new messages fade and slide in. ✅ Automatic retries: Failed requests due to rate limiting are retried automatically before surfacing an error.

👀 Preview

📸 Screenshots of the running app aren't available in this repository yet — build and run the project in Android Studio to see it in action (see Installation Guide below).

📂 Project Structure

java-android-messenger/
├── app/
│   └── src/main/
│       ├── java/uz/asilbek/socialchat/
│       │   ├── MainActivity.java              # Chat screen: input handling, message list, animations
│       │   ├── ApiService.java                # Gemini API requests, retries, and response parsing
│       │   ├── Message.java                   # Message data model
│       │   └── MessageDatabaseHelper.java     # SQLite schema and CRUD operations
│       ├── res/
│       │   ├── layout/activity_main.xml       # Chat screen layout
│       │   ├── drawable/                       # Message bubble, button, and background styles
│       │   └── values/                         # App name, colors, and theme
│       └── AndroidManifest.xml
├── build.gradle
└── README.md

⚙️ Installation Guide 🛠️

1️⃣ Clone the Repository 📥

git clone https://github.com/AsilbekCodes/java-android-messenger.git

2️⃣ Open in Android Studio 📂

Open the java-android-messenger folder as a project and let Gradle sync.

3️⃣ Add Your Gemini API Key 🔑

Open app/src/main/java/uz/asilbek/socialchat/ApiService.java and replace the placeholder with your own key:

private static final String API_KEY = "API_KEY";

Get a free key from Google AI Studio.

4️⃣ Run the App 🚀

Select an emulator or connect a physical device, then click Run.

🖥 Technologies Used

Java Android SQLite Gemini API

📜 License

This project is open-source and available under the MIT License.

🤝 Contributing

🎯 Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages