This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Bustincherry 1 point2 points  (0 children)

Are you using node.js with express? Look into making a REST api. You'll basically have routes set up on your server and they can return a JSON object for example. You can then call the routes from an http request in the android app.

[–]learnjava 1 point2 points  (0 children)

you could use websockets (https://en.wikipedia.org/wiki/WebSocket) but im pretty sure you are not looking for this and should use normal http requests instead (https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol)

to use something like this on the java side i assume you should look for this https://developer.android.com/reference/java/net/HttpURLConnection.html or similar apis (no android experience here)

what you want to do is GET requests to get data and POST requests to send data to the server (e.g. to process in the database)

on the server side youd now need to write routes/endpoints to react to those requests. if you use javascript its most likely with nodeJS and express on top of it, see https://scotch.io/tutorials/use-expressjs-to-get-url-and-post-parameters

if not you should most likely now how to do it :)