Android Bluetooth issues

I’m currently developing a game for Android that features bluetooth multiplayer and I am coming across some tricky issues.

Firstly, it appears that some older phones have custom bluetooth implementations that don’t play well with the bluetooth API. I’ve seen this for myself when testing with my HTC Desire (Android 2.2), which can host a bluetooth game but not connect as a client (other non-htc devices can connect without any problems). A common solution involved using java reflection to access non-public methods of the API, but not only is this a messy solution it didn’t solve the problem for me anyway. Has any one else run into this problem or found a solution without rooting the device?

I’ve also noticed that after a while the bluetooth connection becomes unreliable, in order to fix it I either switch bluetooth off and on again, or in some cases, restart the phone. Is it possible I’m ‘gunking up’ the bluetooth adaptor, or is this expected behavior? Either way, is it possible to somehow do a flush/reset without turning things off?

Bluetooth is basically shit.

Why not use the Wifi capabilities of the phones instead?

Cas :slight_smile:

I’m hoping to offer both bluetooth and wifi options. The main reason I’m including bluetooth is that people are generally pretty familiar with it and it can be used anywhere. When it works, it works pretty well - but if I can’t get over these issues the user experience is going to be a little rough on some devices.

Fair enough - though I can’t help but thinking you might just want to default to WiFi and use Bluetooth if that fails.

Cas :slight_smile:

Sorry for digging up an older thread, but I wanted to post a follow up in case anyone comes across this looking for answers. My advice, is listen to Cas and forget Bluetooth for multiplayer games. The fact that I couldn’t get two HTC phones to connect for love 'nor money was kind of a deal breaker. The experience was also extremely clunky for two unpaired devices. The process differs slightly depending on the OS version, but requires displaying the notification bar (which interferes with your awesome UI), hoping the notification actually goes though (it occasionally won’t), or requesting the user to leave the application, go to Android Bluetooth settings and pair there. This would probably be fine for apps, but I think gamers have come to expect a slicker experience. To be fair, the Android people set it up this way for perfectly valid security reasons.

In the end I felt it brought the quality of the entire game down and I dropped Bluetooth multiplayer. I’m sure these issues could be solved by better men than me, and there are doubtless some cases where it would be fine, such as a bluetooth poker game or something like that.

With Wifi, the host clicks one button to start a game. The clients click one button to join. It’s bloody marvelous.