@Frob: *Insert Morpheus Meme* What if i told you ... that wifi is not just internet */Insert Morpheus Meme*
I think he meant with Wifi just Wireless LAN, which as the name states is just an LAN, where you can establish socket connections.
I didn't made anything with Android yet, but used both methods on Windows Phone, so i'm referencing to how it is made on Windows Phone. But i think it will be similiar on Android. However i will list you the features and cons/pros of both methods so you can decide on your own, wich fits best.
- Bluetooth: As said you have a range up to 10m, so your players have to sit next to each other. Both smartphones will publish something like a service to find each other and then establish a Bidirectional Stream Socket like connection. This means you can send data in both directions asynchron. The connection will be peer to peer, without anything in between.
- Wifi/WLAN: For WLAN both devices have to be in the same network. So an access point is required, or one smartphone has to provide a wireless network. However this has to be done before they get into you game. Then it acts like a normal LAN, so you have to use sockets, connect via IPs and so on (There might be some API that provides automatic connection like this one http://developer.android.com/training/connect-devices-wirelessly/nsd.html). But the difference to Bluetooth is, you will have something like a server and a client. The server has to listen for incomming connection and the client has to connect to you server. Your range depends on the network, so both player could sit in different rooms.
I think in the end either way you will get just an data socket, where you can read write you data form and to. I didn't mentioned the data rate, but for a game that shouldn't matter at all. Only if you have to transfer very big amout of data, like images or sounds.
Best way for a customer would be to have both ways. So either they can choose what they want to use or you make automatic system, which decides what to use. Something like, first check if both user are on the same Wireless network, if so, use it. Then try to establish a Bluetooth connection, if it fails prompt the user to create a local wireless network.
And for wifi, there is a new feature called Wifi Direct, which lets you connect two devices via WLAN but without a network (like Bluetooth but uses WLAN adapter). But that is not supported on all devices, mostly only on newer ones.
For the "how do i programm it" you can look into the android documentation. Start at Bluetooth or Wifi and move along the links through connecting until sockets, where you can finally send data.