Is it possible to exchange messages between two Android devices via Wi-Fi?

I am currently working on an Android mobile app that should be able to send and receive messages using local tools such as Wi-Fi and Bluetooth. After researching about this, I found out that Android does not have a built-in special wifi ad hoc function, and the only way to achieve this is to strengthen your device and fix wpa_suplicant and some other similar methods that are not universal for each device.

A brief description of what I'm trying to achieve:

An Android app that scans nearby devices and tries to automatically connect to them. If the other device also does not receive this application, it automatically accepts any connection request that it receives, and when the connection is established, it sends back a message that guarantees that it is established by this application so that both can automatically exchange messages, t should allow / prohibit any sending / receiving in real time.

My questions:

  • Is there a way to send messages via Wi-Fi between two device androids without using the Internet?
  • Since Ad Hoc is not supported, is there an alternative?
  • If the answer is no 2, is it possible to make one of the devices need to be an access point so that others can connect to it and vice versa.
  • As for bluetooth, is it possible to skip or automate the resolution / prohibition of the incoming connection pop-up window and the pairing procedure?

I would be glad if you could give me an answer to these questions and / or any suggestions.

+7
source share
1 answer

You can communicate between two devices via Wi-Fi without a router / access point using Wifi Direct (P2P) in Android 4.0.

Otherwise, I don’t think you can achieve this via Wi-Fi (Bluetooth will be a better alternative). Starting with version 2.2, you can configure your phone as a Wi-Fi access point (to bind a network connection to the device), but during this time Wi-Fi equipment is not available for normal use. If you have 3 devices, they can work (1 AP, 2 to it).

Is it for a permanent connection or a one-time small delivery? You can use NFC if you want to pass a URL, for example (Android Beam integrates this type of sharing in Android 4.0, but can implement it in version 2.3).

+4
source

All Articles