Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📡 Socket-Based Mobile Communication System with Database Integration

Project Overview

This project is designed to fulfill the requirements of a socket interface application integrated with a database. It features a custom Android mobile client that communicates over Wi-Fi with a Python backend server. All transmitted data is permanently stored in an SQLite database to ensure persistence and traceability.


Key Features

🔹 Python Multi-Threaded Server

  • Handles multiple client connections concurrently using threading.
  • Ensures efficient and reliable message processing.

🔹 Persistent Storage

  • Automatically logs all incoming messages.
  • Stores timestamps and sender IP addresses.
  • Data is saved in an SQLite database (app_data.db).

🔹 Flutter Mobile Client

  • Modern and responsive Android application.
  • Simple and intuitive user interface.

🔹 Dynamic Configuration

  • Custom Settings page included.
  • Allows dynamic server IP configuration without recompiling the app.

🔹 Error Handling

  • Robust connection management.
  • Handles network timeouts and unexpected server disconnections gracefully.

Technology Stack

Backend

  • Python 3
  • Socket Library
  • SQLite3
  • Threading

Frontend

  • Flutter (Dart)
  • shared_preferences (for local storage)

Network Protocol

  • TCP/IP
  • Default Port: 6000

⚙️ Setup and Installation

Server Side (Linux / Windows / macOS)

The server can run on any machine with Python installed.

Step 1: Clone the Repository

git clone https://github.com/wol-98/socket-mobile-project.git

Step 2: Navigate to Project Directory

cd socket-mobile-project

Step 3: Run the Server

python3 server.py

The server will start listening on Port 6000.


Client Side (Mobile Application)

The mobile application is built using Flutter.

Option A: Install APK

  • Transfer app-release.apk (if available in Releases) to your Android device.
  • Install the APK manually.

Option B: Build from Source

cd my_app
flutter pub get
flutter run

Usage Guide

Step 1: Start the Server

Run the following command on your computer:

python3 server.py

Find your computer’s IP address:

Linux:

hostname -I

Step 2: Configure the Mobile App

  1. Open the mobile application.
  2. Tap the Settings (Gear Icon) in the top-right corner.
  3. Enter your computer’s IP address.
  4. Click Save.

Step 3: Send Data

  1. Type a message in the input field.
  2. Press the SEND button.

Step 4: Verify Communication

  • The sent message appears instantly on the server terminal.
  • The server sends a confirmation response:
Server replied...

Step 5: Verify Database Persistence

To confirm that data is being stored successfully, run the following command on the server machine:

sqlite3 app_data.db "SELECT * FROM messages;"

This will display all logged messages along with timestamps and sender IP addresses.


Project Structure (Example)

socket-mobile-project/
│
├── server.py
├── app_data.db
├── my_app/
│   ├── lib/
│   ├── pubspec.yaml
│   └── ...
└── README.md

Author Information

  • Name: Wol Wol
  • Stream: TYBSC-IT
  • UID: 2305074

Academic Submission

Course: Network Socket Programming Project Type: Socket Interface Application with Database Integration


Conclusion

This project demonstrates real-time communication between a Flutter-based mobile client and a Python socket server with reliable data persistence using SQLite. It effectively showcases concepts such as multi-threading, TCP/IP communication, database integration, and mobile application development.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages