0

I have created a login Page for my android application.

My android application sends data using POST method to server.

Server returns data in the form of JSON text format to android application.

Is this the right way for communication between an android application and server ?

Some people use Web service. When do we use that and when do we not use that ?

Charles
  • 50,943
  • 13
  • 104
  • 142
abhinav
  • 527
  • 3
  • 11
  • 24

3 Answers3

4

Server responds the data in JSON Format or could be anything it depends on you. WebServices is only way to get that data by sending the request. Method can be GET OR POST again based on your request and the amount of data you are sending with your request.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
rupesh
  • 2,865
  • 4
  • 24
  • 50
  • some people use some SOAP based code for login pages ? Whats that, sorry i am new to web services – abhinav Jan 21 '14 at 07:38
  • @abhinav SOAP and Rest are two type of web-services. I will suggest you to use RESTful Webservices. – rupesh Jan 21 '14 at 08:19
  • @abhinav http://stackoverflow.com/questions/2142070/why-should-a-developer-use-web-services-instead-of-direct-connections-to-a-db?lq=1 – rupesh Jan 21 '14 at 08:25
1

you are already using web services to exchange json objects. you are just confused in the data format and the web services.

there are 2 types of data formats that you could use,

  • JSON

    XML

and 2 types of web services,

  1. RESTful services are the most used flavor of Web Services. They are closely linked to the functionality and principles of HTTP and be accessed as simple as a GET request (other operations are POST, DELETE and PUT). The core concept is the "resource" which is identified by an URI. Common formats for REST are XML and JSON. It's a pretty straightforward and easy to use technology, which is what makes it so widely available.

  2. SOAP web services are based on XML, most of them adhering to the RPC-style of app design (calling remote methods on a server and getting a response), and use 3 main pillars:

    • WSDL - Web Service Description Language - used to describe a service in terms of available operations, parameters, etc.
    • SOAP - Simple Object Access Protocol - used to construct interaction messages between the entities involved (client, server).
    • UDDI - Universal Description, Discovery and Integration - used to classify and publish available web services to a repository and enable discovery by potential users.

SOAP Web Services tend to have high overhead and generally have very verbose messages, but may be good if you need to implement more complex functionality and interaction in your application.

Sahil Mahajan Mj
  • 11,033
  • 8
  • 53
  • 100
0

Web Service is the only way to communicate between Android App and Server. JSON is just the format of the request and response sent and received via Web Service. SOAP is also a kind of format of the request and response.

Dhruv Jindal
  • 1,056
  • 10
  • 17
  • Thanks alot. I am using HttpPost class in android to create a request. Do I need to use anything else along with this for making it better ?? people talk about restFUl API and SOP. Is anything of that required ? – abhinav Jan 21 '14 at 08:52
  • no, you don't need anything else. HttpPost will work just fine. Do accept my answer if it helped you. – Dhruv Jindal Jan 21 '14 at 08:56
  • sure I will thanks for the response. – abhinav Jan 21 '14 at 09:00