How to connect to bluetooth device in Java?

Is there a way to set up an Android Smartphone to automatically connect to a bluetooth device when that device is on and an app is open?

  • Here's a use case: I have a bluetooth speaker to which the phone is registered.  When I open Pandora or Spotify, IF the device is in range and on, it should use that device. Reason I'm asking is that it doesn't work that way; and I'm point this out only in case I have something setup wrong.  How it actually works is that I have Connect to the device first.  When bluetooth is enabled on the phone or the speaker is turned back on, even though the devices are registered to one another, you still have to connect them.  THEN when you open said apps, the sound will play there. From a user experience standpoint, that's a terrible process.   1. Turn on speaker 2. Enable bluetooth 3. Open the screen of devices that can be connected 4. Select speaker so it can be used 5. Open the app Better: 1. Turn on speaker 2. Enable bluetooth 3. Open the app Have I set something up wrong or is there a way to automate some of this so it works? (e.g. ?)

  • Answer:

    Try the Tasker app.

Juan Guzman at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.