Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure what you mean by "manually": Do you mean "manually" as in GUI/user interaction, or "manually" as "I do it in my own application code"?</p> <p>Some suggestions though:</p> <p>If you can make your BT devices discoverable at all, you could do it this way:</p> <ol> <li>Make your BT device discoverable</li> <li>Let Android search for and find the device and then initiate a connection</li> <li>Android will ask for the PIN for pairing with the device; enter the PIN.</li> <li>Once pairing was successful, Android stores the pairing information for future use, so that you can</li> <li>Make your BT device invisible again.</li> </ol> <p>From then on your app should be able to connect to the BT device at any time without further pairing operations.</p> <p>If the said is not an option for you, maybe you want to go another way:</p> <p>In current Android versions there are different API routines implemented which are neither documented nor exposed in the normal SDK. A hack kind of solution may be to use some of these "hidden" ("@hide"...) APIs, either via reflection or via modification of your SDK installation.</p> <p>But be aware that this is always a <em>hack</em> and it may work on a specific device with a specific version of Android and is likely to break your app on another device and/or any other Android version.</p> <p>Having said that, here comes some reference:</p> <p><a href="http://wiresareobsolete.com/wordpress/2010/11/android-bluetooth-rfcomm/" rel="nofollow">Example of how to access "hidden" bluetooth API</a>.</p> <p>Then, have a look at the source code for android.bluetooth.BluetoothDevice, e.g. <a href="https://github.com/CyanogenMod/android_frameworks_base/blob/gingerbread/core/java/android/bluetooth/BluetoothDevice.java" rel="nofollow">here</a>.</p> <p>In there, <code>public boolean createBond(){...}</code> may do what you want.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload