如果你看到“Uno”游戏,你会得到一些想法。在那里,他们没有使用蓝牙,而是使用WiFi。 从中我学到了,以及其他一些等待连接成功的蓝牙游戏。
如果您使用BluetoothChat应用程序作为参考,然后使用您的Handler作为您的事件生成器来启动您的游戏。
// The Handler that gets information back from the BluetoothChatService
private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_STATE_CHANGE:
if(D) Log.i(TAG, "MESSAGE_STATE_CHANGE: " + msg.arg1);
switch (msg.arg1) {
case BluetoothChatService.STATE_CONNECTED:
setStatus(getString(R.string.title_connected_to, mConnectedDeviceName));
mConversationArrayAdapter.clear();
// DO YOUR ACTIVITY HERE .. ..
// May Be like ... Intent intent = new Intent(...)
break;
非常感谢! :d – AbAetherno 2013-05-12 18:34:04