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.
✅ 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.
📸 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).
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
git clone https://github.com/AsilbekCodes/java-android-messenger.gitOpen the java-android-messenger folder as a project and let Gradle sync.
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.
Select an emulator or connect a physical device, then click Run.
This project is open-source and available under the MIT License.
🎯 Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.