Scaraux
Scaraux

Reputation: 4172

Java Android app and Node.js + Express.js API

I'm actually developing an Android Application that needs connection to the internet. In my API, I am using Node.js and Express.js to handle simple requests such as login, register, or retrieving data about other users. I am using multiple HTTP requests type with Express.js, such as POST, GET, PUT, PATCH and DELETE, depending on what the server will have to do. The server is always returning JSON to the client.

I searched on the internet but I didn't find any Framework made to perform HTTP requests from an Android Application. I know that this is possible with some native Java Objects, but I would like something simple and reliable. As I said before, I need to perform different requests (PUT, POST, GET, DELETE etc...).

I saw the OkHttp framework, but It don't seem to do exactly what I want...

Upvotes: 0

Views: 2084

Answers (2)

Scaraux
Scaraux

Reputation: 4172

I used http://square.github.io/retrofit/ which is what I needed.

Upvotes: 1

anstaendig
anstaendig

Reputation: 845

The HttpURLConnection class is everything you need for that. It's not complex so you'll find your way around it pretty quick. The thing you have to think about is asynchronism. This article helps a lot.

Upvotes: 3

Related Questions