Skip to content

Latest commit

Β 

History

History
102 lines (80 loc) Β· 5.51 KB

File metadata and controls

102 lines (80 loc) Β· 5.51 KB

πŸ’¬ 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

πŸ“š Table of Contents

✨ 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/iqbolshoh/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/Iqbolshoh/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/iqbolshoh/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.

πŸ“¬ Connect with Me

πŸ’¬ I love meeting new people and discussing tech, business, and creative ideas. Let's connect! You can reach me on these platforms:

Website Gmail GitHub Telegram WhatsApp Instagram YouTube