简体   繁体   中英

How do I communicate with Android using node.js? (Mysql)

I am trying to communicate with Android on node server basis now. The database is using mysql. I usually do data exchange through json parsing, but I do not know how to use it. If there is a good way, I would appreciate it if you recommend it.

Normally we have to use REST API method for communicating client side application to node server. So host your application (Node server) and make rest call by using the hosted url.

Example: our node server hosted on http://example_host.com

we have create a rest method for getting data from the server.

Method : GET , url : /user_data

so make a call like : http://example_host.com/user_data

it will make a response with data.

For REST check out the excellent retrofit project from square

http://square.github.io/retrofit/

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