简体   繁体   中英

How to use nodejs and express.js to create an android chat app?

I am learning node.js & express right now and I am following a course but I wonder how to use it in a mobile app (android).

I want to create an android chat app using flutter and node.js with express.js and MySQL but the course, for example, returns a response of HTML pages.

I want to use it like a database and a server for a basic chat app.

Am I on the right way?

You can use MySQL as a database of any chat app for learning purposes, for that you have to set up the server with node.js(express) and define routes accordingly for creating chats(single chat or group chats may be public channels). Furthermore, you can make use of sockets with socket.io for creating chatrooms and check the online/offline status of chat members.

Yes you are in the right way. All this functionality remains the same even if you are creating a android app.only what changes is that you dont send response with HTML pages and instead of that you return JSON data in your api's. Your code does all the functionality the same way and insert into Database also the same way but instead of rendering html pages you send response in JSON and hanlde that response in the client side code in your case the flutter app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM