In this tutorial, we'll learn how to build a real-time app with Angular 9/8, Socket.IO, and Node.js.
Socket.IO primarily uses the WebSocket protocol to enable real-time bidirectional communication.
7ag b' fctc.5r.6, k @7:uc( 7a( 'fg?8 g? 9?8 78(#bcu's@'8( )?z'g:( ) 7og 'eg89sg?' Usg 9?8 )?z'7%'c# ) 7og 'b8u'8'i@'og. UC Handler Apk for Android V9.8 Download Uc browser is the one of the most used browser by Android users. The browser have excellent user interface. The UC browser mini handler is the MOD version of the UC browser.
Uc Mini 9.8 Handler Ui Apk
WebSocket is the internet protocol that allows for full duplex communication between a server and clients. The server may send data to a client without the client initiating a request.
You can also read how to build a complete chat app with a hosted service like Pusher Chatkit or PubNub Chat in Building a Chat App with TypeScript/Node.js, Ionic 5/Angular 9 & PubNub/Chatkit
Uc Handler Ui 9.8 Ac
Let's see how to create a simple chat server with socket.io and websockets.
Step 1 -- Creating the Chat Server
Open a new command-line interface and run the following commands to create your server project:
Next, navigate inside the src/
folder, and create a new file called index.js
using the following commands:
Open the src/index.js
file and start by adding the following code:
We simply create an express server and use socket.io to add realtime support. Socket.io implements WebSockets with extra features like fallback for older browsers that do not support the realtime protocol.
We create an instance of express and store it into app
variable. After that we create server with http
module. Then we pass express
to http.Server()
method. Express will serve as the handler for requests to our server. In return we get the instance of server which we store in server
variable.
Next, we listen for the connection
event of socket.io and we display the user connected
message once a user has connected to our real-time server.
Next, we need to listen for the new_message
event, and send the message back sent by a user to all connected users:
Finally, we run the server and start listenning on a specified port or 3000.
Let's now run our server by running the following command:
Step 2 -- Initializing the Angular 9 Project
Open a new command-line interface and run the following command to initialize a new project:
You will be prompted if you would like to add routing to your project - You need to answer by Y to set up the router. For the stylesheets format, let's go with CSS.
Next, let's start a live-reload development server using the following commands:
The server will be running at the http://localhost:4200
address.
Step 3 -- Installing the Socket.IO Wrapper
Next, navigate inside your project's folder and install ngx-socket-io
which is a wrapper for socket.io in Angular:
Step 4 -- Importing SocketIoModule
Open the src/app/app.module.ts
file and start by adding the following imports:
Next, define a configuration object for configuring socket.io as follows:
Next, include SocketIoModule
in the imports
array:
After saving the file, you will be connected to the realtime server. You should see a user connected message in the terminal.
Step 5 -- Creating an Angular Chat Service
Open the src/app/message.ts
file and add the following code:
Next, run the following command to generate a service:
Open the src/app/chat.service.ts
file and update it as follows:
We simply import and inject the Socket
service via the constructor.
Next, define the following method which can be used to send a new message to the real-time server:
Next, we need to define a getMessages
method for getting the messages:
We use the Observable.create()
method to create and return an observable
This will allow us to notify all observers when the socket receives a new message.
Step 6 -- Creating the Chat UI
Next, let's create the chat UI of our application. Let's keep it simple and use the app component for displaying the UI.
Open the src/app/app.component.ts
file and update it as follows:
Open the src/app/app.component.html
file and update it as follows:
Step 8 -- Serving the Chat Front-End
Let's now run the front-end server using the following command:
You can test the chat application by opening more than one browser and navigating to the http://localhost:4200
address.
Conclusion
In this tutorial, we have created a real-time chat example with Angular 9, Node.js, Socket.IO and WebSockets.
The following APKs has been tried and tested by me. These are not my own, If you need the app, you can download it using the links indicated below. Credits to the developers and Modders of these apps (Dzebb / Odiseo Onze / LoveLess999).
Click the link, wait 5 sec. and skip the ads:
Mobile Browsers
Opera Mini 7.5.4 HUI Handler (DatafileHost Click Here)
Opera Mini 7.5.3 (DatafileHost Click here)
UC Mini 100 YK Handler (DatafileHost Click Here)
UC 9.8 Handler HUI (DatafileHost Click Here)
UC 9.1.1 Clash of Clans Skin (DatafileHost Click Here)
Oupeng 772 YK HandlerUI (DatafileHost Click Here)
Opera Nextwap 75 handler HUI (DatafileHost Click Here)
VPN
Backup App
Titanium Backup 7.1.2 (DataFileHost) (MediaFire)
Free Text Messaging to the Philippines