Download presentation
Presentation is loading. Please wait.
1
Software Engineering for Internet Applications
Mobile Apps Programming - Android Socket ADF 1/11/2019
2
Java Socket Remember Socket Programming?
Multi-client chat via TCP Socket Build Android Socket for Client 1/11/2019
3
Server Chat Use the same Server.java Modify ServerThread.java
Remove buffered reader as the input is no longer from string stream, change to Data Input Stream Create new Android Project for Client 1/11/2019
4
Server Thread ServerThread.java 1/11/2019
5
Server Thread ServerThread.java 1/11/2019
6
Android Client Create an Empty Project 1/11/2019
7
Android Manifest As the application will try to connect the network, add permission in the manifest file 1/11/2019
8
UI Layout 2 views Login panel view (vertical linear layout)
Username input text Server address input text Connect button Chatting panel view(vertical linear layout) Chatting input text Send button Disconnect button Scroll view chat log 1/11/2019
9
UI Layout 1/11/2019
10
UI Layout View Chat Panel only when the connection is established
Set chat panel visibility “gone” Give hint to input text username, server address, input chat Best practice to set all text value in string.xml 1/11/2019
11
UI Layout 1/11/2019
12
UI Layout 1/11/2019
13
UI Layout – Login Panel 1/11/2019
14
UI Layout – Chat Panel 1/11/2019
15
Client Thread Class Create client thread class 1/11/2019
16
Client Thread Class 1/11/2019
17
Client Thread Class 1/11/2019
18
Client Thread Class 1/11/2019
19
Client Thread Class 1/11/2019
20
Client Thread Class 1/11/2019
21
Main Activity Set server port number Add all element 1/11/2019
22
Main Activity Initialize resource activity in onCreate() method
1/11/2019
23
Main Activity Create Listener for each button 1/11/2019
24
Main Activity 1/11/2019
25
Main Activity Set onClickListener in onCreate() method 1/11/2019
26
Run Application Run Server Run Android Client Connect to IP Server
1/11/2019
27
1/11/2019
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.