This repository contains the Android mobile client for the Social Network application. It complements the web client by providing a native mobile experience. The Android application communicates with the server backend to provide functionalities like user registration, posting, commenting, and more.
- Server: Java Spring Boot backend. Server Repository
- Web Client: Angular frontend.
- Mobile Client: Android application. Mobile App Repository
- Java Development Kit (JDK) 11 or higher
- Android Studio
- A device or emulator with Android API level 21 (Lollipop) or higher
- Internet connection
Clone the Android mobile app repository to your local machine:
git clone https://github.com/anna02272/Social-Network_mobile
- Open Android Studio.
- Click on
File -> Open...
and select the cloned repository folder. - Android Studio will import the project and sync the Gradle files.
Ensure all Gradle dependencies are downloaded. Android Studio should automatically start syncing the project. If it doesn't, you can manually sync it by clicking on File -> Sync Project with Gradle Files
.
-
Create a Firebase Project:
- Go to the Firebase Console.
- Click on
Add project
and follow the steps to create a new project.
-
Add Firebase to Your Android Project:
- In the Firebase console, click on
Add app
and selectAndroid
. - Register your app with the package name (e.g.,
com.example.socialnetwork
). - Download the
google-services.json
file. - Place the
google-services.json
file in theapp/
directory of your Android project.
- In the Firebase console, click on
Ensure that the server backend is running by following the instructions in the server repository.
To enable communication between the mobile application and the server, both must be connected to the same network. Find the IP address of the device where the server is running. Access the server through the IP address and port (e.g., http://192.168.0.26:8080
).
Since you don’t want to hardcode the IP address in the source code, save it in the local.properties
file in the root of your project. Add the following line:
ip_addr=192.168.0.26
- Connect your Android device to your computer or start an emulator.
- In Android Studio, click on the
Run
button or pressShift + F10
. - Select the device or emulator to run the application.
- User Registration: Register new users.
- Login and Logout: Log in and out of the system.
- Posting: Create posts with or without images.
- Commenting: Reply to posts and comments.
- User Reactions: Like, dislike, and heart posts and comments.
- Profile Management: Change password, update profile data including display name, description, and profile picture.
- Search: Search for users and manage friend requests.
- Group Management: Create and administer groups, handle join requests, and manage group content.
- Kotlin
- Retrofit for Networking
- Firebase for Cloud Storage
- Android Jetpack Components
- User authentication using username and password.
- Authorization using the token mechanism.
- Log messages about important events during application execution.