Take the 2-minute tour ×

I intend to create an app that can connect to 2 wi-fi devices and transfer data between them. My question is how do I keep one connection alive while communicating with the other.

Is there any method to remember the connections and switch between them? Will using the wi-fi direct API prove more beneficial?

share|improve this question
"Some devices certified under the Wi-Fi Direct program will support connections to both an infrastructure network and Wi-Fi Direct-certified group at the same time" (see wi-fi.org/files/faq_20101021_Wi-Fi_Direct_FAQ.pdf). In other words, there's not really any guarantee that you can have both kinds active at the same time. –  Michael Jan 22 '13 at 17:51
@Michael Any way to do the task without wi-fi direct? –  Mayur Jan 22 '13 at 18:21
IIRC from when I was discussing such a use-case with a WiFi chip maker a couple of years ago, it's not possible to be connected to more than one infrastructure network (like a regular Access Point) at the same time (though I may be remembering incorrectly). Connecting to one infrastructure network + another device over WiFi Direct should work one some devices as the document I linked to states. But you could run into devices where it doesn't work. Not sure about switching connections since that's not something I've ever considered or investigated. –  Michael Jan 22 '13 at 18:29
@Michael If what u say is correct, how do programs like Connectify and mhotspot work? I use my laptop to connect to an AP and I connect my phone to my laptop via AP made by Connectify or mhotspot and share my internet connection.A similar aproach exsists for Linux. This is a case of the same WiFi chip connected to 2 APs.So I guess it is possible. But is it possible to achieve something similar in the Android system? –  Mayur Jan 22 '13 at 19:21
From the description of those applications it sounds like they would be the group owner of a WiFi Direct group (i.e. the "access point"). WiFi Direct does allow for multiple clients within a group to connect to the owner (both of those apps also have lists of supported network adapters on their websites). If that's also what you want to do, then it should work on a WiFi Direct-capable device. If, on the other hand, you want your app to act as a client that connects to multiple groups then it may not work on some devices (I haven't found any clear statement regarding support for this). –  Michael Jan 22 '13 at 19:57
show 1 more comment


Your Answer



Browse other questions tagged or ask your own question.