Para documentação em português, consulte o README em Português.
This is a cross-platform chat project in Kotlin that utilizes Compose to create user interfaces for desktop and Android, OkHttp for communication with a WebSocket server, and Gson for message serialization.
- Cross-platform support for Desktop and Android.
- Real-time communication through a WebSocket server.
- Message serialization and deserialization using Gson.
- Simple and elegant user interface created with Compose.
demo.mp4
- Make sure you have Android Studio or IntelliJ IDEA set up with Kotlin and Compose dependencies.
-
Clone the repository:
git clone https://github.com/eduardomcb/simple-chat-multiplatform.git cd simple-chat-multiplatform
-
Open the project in your development environment.
-
Build and run the application in your desired environment (Desktop or Android).
To run your desktop application in Android Studio, select desktopApp
in the list of run configurations and click Run:
You can also run Gradle tasks in the terminal:
./gradlew run
to run application./gradlew package
to store native distribution intobuild/compose/binaries
To run your application on an Android emulator:
-
Ensure you have an Android virtual device available. Otherwise, create one.
-
In the list of run configurations, select
androidApp
. -
Choose your virtual device and click Run:
Alternatively, use Gradle
To install an Android application on a real Android device or an emulator, run ./gradlew installDebug
in the terminal.
This chat project depends on a WebSocket server to function. You can find the source code for the WebSocket server in Node.js in the following repository:
Make sure to set up and run the WebSocket server before starting the chat application.
If you'd like to contribute to this project, feel free to create pull requests or report issues in the Issues section.
This project is licensed under the MIT License - see the LICENSE file