Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Client Server communication

I have an application in Android which get latitude and longitude from GPS. I want to send these lat and long to server at particular port and want to receive the response of server into my Android application.

Kindly give the direction so that I can make it possible.

like image 506
Siddiqui Avatar asked Mar 01 '11 05:03

Siddiqui


People also ask

What is client/server communications?

Client/Server communication involves two components, namely a client and a server. They are usually multiple clients in communication with a single server. The clients send requests to the server and the server responds to the client requests.

What are the three types of client server communication?

Types of Client Server Communication are: HTTP Push and Pull. Ajax Polling. Long Polling.

How does mobile app communicate with server?

In an OutSystems Mobile application, all the communication between the app and the Platform Server is done through REST calls. All the calls to Aggregates/Data Actions and Server Actions in Mobile modules will have REST endpoints generated automatically by the platform.


2 Answers

There are many ways to perform this data transfer using the Android platform.

My preference is to use JSON to communicate between the App and the server. For an example of how to implement this in your app read through this article: http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/

like image 102
Joel C Avatar answered Nov 08 '22 22:11

Joel C


If you want to upload some information to web server, simple way is to use GET method in your web server part. you may pass two parameter latitude + longitude to server.

Second thing is to communicate with server to mobile device. Better way is to use JSON format to communicate between them. Try to understand the JSON format and implement it.

like image 25
Mohammad Ullah Avatar answered Nov 08 '22 20:11

Mohammad Ullah