Question

So I don't really see anything online for how I would start attacking this problem, but I know it's possible so I figured I would ask here :)

I'm currently reading up on bluetooth enabling and sockets in an Android book, and I want to try a simple project where I sync a PS3 controller to my app so that I can read the signal and display it some values in order to figure out which codes correspond to which buttons/joystick movements. The problem is, after I have enabled bluetooth and set the app to discover other devices, my controller isn't picked up while on. All of the code I have so far comes from Professional Android 4.0 Development published by Wrox, so the source can be found there under chapter 16. I'm just wondering if there's something I'm missing with how the PS3 controller works that would cause it to be undiscoverable, or if I need to do something special to pick up devices that I'm not catching. Thank you!

private void startDiscovery() {
  registerReceiver(discoveryResult,
                   new IntentFilter(BluetoothDevice.ACTION_FOUND));

  if (bluetooth.isEnabled() && !bluetooth.isDiscovering())
    deviceList.clear();
    bluetooth.startDiscovery();
}

BroadcastReceiver discoveryResult = new BroadcastReceiver() {
  @Override
  public void onReceive(Context context, Intent intent) {
    String remoteDeviceName = 
      intent.getStringExtra(BluetoothDevice.EXTRA_NAME);

    BluetoothDevice remoteDevice =  
      intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);

    deviceList.add(remoteDevice);

    Log.d(TAG, "Discovered " + remoteDeviceName);
  }
};
Was it helpful?

Solution

I think that playstation console and controller operate on a unique bluetooth signal you have to look for open source that you can integrate into android i just searched here is one there could be plenty more, theres a way out there somewhere, you just gota find the right code librarys

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top