Daniel Sibaja
Daniel Sibaja

Reputation: 1367

How to communicate two android devices?

Hi guys could any one help me a little bit, I'm making an android app, for cabs request, but I need a way to send to the driver app, an alert where he accepts the invitation to pick up the client, if he choose the accept button, and alert pops up on the client app telling him that the driver is on the way :) Thanks, I think i need for Threads to me always watching for these client notifications.

Upvotes: 0

Views: 4299

Answers (2)

C--
C--

Reputation: 16558

This question depends on a few factors. Whether there is a server to control the communication mechanism or not. Whether the devices are close to each other. Whether there is a network oriented method like SMS allowed to be placed and so on. To minimally answer this, the following could be the easiest way to communicate between two Android devices.

  • If the devices are close to each other, use Bluetooth
  • If the devices have a server to connect in between, use an Android service to take the connections things to the background
  • If there is an SMS/Call based connection between the devices, use Intents and Content providers to further deal with the data.

Upvotes: 1

Shadow
Shadow

Reputation: 6899

You can use Socket programming. This is an example where it shows how to communicate between two android phones.Example shown in emulators

http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/

Upvotes: 2

Related Questions