Networking Slides
Networking Slides
Networking
Mobile Computing
Submitted To:
Prof.Dr.Kaleem Razzaq Malik
Group Members
• 233518(Tooba Ghafar)
• 233520(Komal Naz)
• 233582(Amna Sajjad)
• 233522(Fatima Rani)
• 233552(Malaika Batool)
Introduction
Function: isNetworkConnected()
•Purpose: Check if the device has an active internet
connection.
•Steps:
1.Get the ConnectivityManager from the
system service.
2.Obtain the currently active network.
3.Get network capabilities for the active
network.
4.Return true if the network has the
NET_CAPABILITY_INTERNET.
Using the
Connectivity Check
Importance of
Networking
Peer-to-Peer
Communication
• Devices can talk directly to each other without
internet:
• Wi-Fi Direct – for file sharing
• Bluetooth – short-range chatting
• P2P Chat Apps – LAN-based apps for local
messaging
Encrypted Messaging
Over LAN
Objective:
•Enable private LAN chat between Android
devices.
•Use AES encryption for secure messaging.
•Discover nearby devices using UDP broadcast.
Device Discovery:
•Devices send a UDP packet:
"LAN_CHAT_DISCOVERY" to
255.255.255.255:8888.
•Other devices listen on port 8888 and respond
with their IP.
•Symmetric algorithm encrypts/decrypts
messages.
•Ensures message privacy over LAN.
• TCP Socket Communication:
• After discovery, a TCP connection is made.
• Messages are encrypted → sent via TCP →
decrypted and shown.
• Why TCP?
• Ensures reliable, ordered message delivery.
• Threads are used for network I/O to keep UI
responsive.
• Main Features & Ouput:
• Chat window with encrypted message
display.
• "Discover" button sends UDP broadcast.
• List of discovered devices.
• Click a device → Start secure chat.
TCP/IP in Mobile
Networking
• TCP/IP in Mobile Networking
• Content:
TCP/IP is the rulebook for sending data.
4 layers:
• Application Layer – Apps (e.g., WhatsApp)
• Transport Layer – Ensures data is sent fully (TCP)
• Internet Layer – Finds the best path (IP)
• Network Layer – Sends the data over Wi-Fi or 4G
Wireless Technologies
in Mobile Computing
• Comparison:
• Wi-Fi – Medium speed/range, used at home
• Bluetooth – Short range, for file sharing or
headphones
• NFC – Very short range, for payments
• LTE/4G/5G – Wide range, fast internet
Use a table or chart.
01.
Future Trends