I am currently working on the creation of an application for mobile devices with Android which should be capable of sending and receiving messages through local means like wifi and bluetooth. After making a research about it I found out that Android doesn't have a native wifi ad hoc functionality and that the only way to achieve that is through rooting your device and patching the wpa_suplicant and some other similiar methods which are not generic for every device.
Synopsis of what I am trying to achieve:
An application for Android that scans for devices nearby and tries to connect to them automatically. If the other device also got this application isntalled then it automatically accepts any connection request it receives and when the connection is established it sends back a message which ensures that it has this app installed so that both can start exchanging messages automatically and the users don't have to allow/deny any of the sending/receiving in real time.
My questions are:
I'll be glad if you could give me an answer to those and/or any suggestions.
Tip: You can send texts over Wi-Fi even if you don't have cell service. Just use Messages as you normally would. If you're not connected to Wi-Fi, make sure cellular data is turned on: On your Android device, open the Settings app.
Wi-Fi Direct (also known as peer-to-peer or P2P) allows your application to quickly find and interact with nearby devices, at a range beyond the capabilities of Bluetooth. The Wi-Fi peer-to-peer (P2P) APIs allow applications to connect to nearby devices without needing to connect to a network or hotspot.
You'll be able to communicate between two devices over wifi without a router/access point using Wifi Direct (P2P) in Android 4.0.
Otherwise, I don't believe you can achieve this over Wifi (bluetooth would be the next best alternative). Since 2.2 you can set your phone up to be a Wifi Access Point (for tethering your device's network connection), but during this time, the Wifi hardware is unavailable for normal use. If you had 3 devices it could work (1 AP, 2 connecting to it).
Is this for a constant connection, or a one-off small delivery? You could use NFC if you want to transmit a URL for example (Android Beam integrates this type of sharing in Android 4.0, but could implement it in 2.3).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With