ace
ace

Reputation: 12034

Integrating Web Application running in Tomcat server with Android application?

I have a Java web application running on Tomcat which manages incoming requests for database updates from Android game application. For example Android app may do a POST URL like: /mycontroller/updateScore/?score=345&id=123456789

which updates the user score as he is playing the Android game app and the server sends simple success or error response.

The above approach is plain HTTP URL based just like in a traditional web application and user interacting with it with a web browser.

The second alternative I am thinking about is: RESTful JSON Web services to integrate my web application with the Android application.

Will RESTful JSON provide higher performance solution?

Upvotes: 0

Views: 1052

Answers (1)

duffymo
duffymo

Reputation: 308958

REST is HTTP, so there won't be any advantage there.

JSON will be a more efficient message protocol than XML, but I can't see that it'll offer any advantage over the POST URL in your question. The URL solution will let the web server parse the HTTP request and present the query parameters as name/value pairs. If you send JSON your app will have to do the extra parsing.

I think a REST/HTTP solution should work and perform well enough. I'd recommend sticking with it until you have evidence that it can't work and then adjust.

Upvotes: 1

Related Questions