0

I am writing an app to allow two android devices to play together. I'd like to know can I make a p2p connection with wifi between the two android devices without a third devices?

flexwang
  • 625
  • 6
  • 16
  • Is this the same (will this approach work)? http://stackoverflow.com/questions/4071322/android-acting-as-a-wifi-server-hub?rq=1 – mobill Sep 11 '13 at 15:25
  • [Or this one](http://stackoverflow.com/questions/6720899/can-i-use-wifi-to-transfer-data-messages-between-two-android-phones-not-connect?rq=1) – mobill Sep 11 '13 at 15:31
  • The question is quite specific; having two possible affirmative answers (each constrained to a subset of devices) does not make it "too broad". – Chris Stratton Sep 11 '13 at 16:05

2 Answers2

2

As long as you can target API level 14 and above you should be using the built in Wifi direct API's. Google has posted a very detailed guide on how to get WifiP2P working on Android.

Bobbake4
  • 24,509
  • 9
  • 59
  • 94
  • I think that's what I am looking for. But, I really want to make my app work on android 2.3 and above. Maybe I should use bluetooth to connect? – flexwang Sep 12 '13 at 00:11
  • Bluetooth would work but it's data transfer rate is not as good as Wifi and you have to deal with the messy pairing. If you target 4.0 and above you will be losing possibly 30% of your market but remember that part is shrinking every day. You can check the official numbers here http://developer.android.com/about/dashboards/index.html. – Bobbake4 Sep 12 '13 at 00:17
  • Actually, I am writing this app for a competition, and the requirement is that app should work on android 2.3 and above. I'll think about wifi when I am about to post the app in to market. – flexwang Sep 12 '13 at 00:40
2

Start from Device A - "Tethering and portable hotspot" Connect Device B to created hotspot

Nikhil Pingle
  • 747
  • 7
  • 11