3

I found this question in the first post review queue:

Android/Bluetooth programatically pairing options

I have a list of BluetoothDevice and I want to pair programmatically with one of them that has a PIN.

I have read several posts here in which the subject is discussed, but I've found two very different approachs.

FIRST OPTION: You call the device.createBond() method. Then, on a BroadcastReceiver, you listen the BluetoothDevice.ACTION_PAIRING_REQUEST action and there you call

device.setPin(PIN_BYTES);
device.setPinConfirmation(true);

You can see the complete example & post here: How to pair Bluetooth device programmatically Android

SECOND OPTION: What if you call device.setPin(PIN_BYTES) and device.setPinConfirmation(true) first, and then device.createBond() ? Eg:

  if(connConfig!=null && connConfig.bluetooth!=null){
            device.setPin(connConfig.bluetooth.pass);
            device.setPairingConfirmation(true);
            device.createBond();
}

And then you forget about listening the BluetoothDevice.ACTION_PAIRING_REQUEST action on your BroadcastReceiver and only pay attention to BluetoothDevice.ACTION_BOND_STATE_CHANGED events? Android + Pair devices via bluetooth programmatically
See in the first answer the code. As far as I get it , that dude isn't using any PIN for pairing, so I also need to use the setPin method.

Which of both you find better?
Am I missing something? BTW: Im not using reflection because Im not targeting older platforms. Thanks!

The user presents two ways to achieve his goal and asks "Which of both you find better?" and "Am I missing something?"

I flagged this question as "primarily opinion based" because—in my opinion—this is a "best practice" question, but the flag was disputed.

Why was my "primarily opinion based" flag disputed?

6
  • Even though the question contains the words "which is better", it seems pretty clear that there are two different methods to accomplish supposedly the same thing, and it's not clear whether one or the other has some hidden drawbacks or pitfalls and should therefore not be used [in some situations]. Seems reasonable enough to me.
    – deceze Mod
    Commented Jan 17, 2017 at 9:06
  • At least it's not "Do you guys prefer apples or pears? Which is better?"
    – Cerbrus
    Commented Jan 17, 2017 at 9:07
  • I agree about the primarily opinion based but It has the beginnings of a good question. Before seeing this question here on Meta I added a comment asking the questioner to clarify their real question. That gives them an opportunity to improve the question before any stronger actions are taken.
    – AdrianHHH
    Commented Jan 17, 2017 at 9:18
  • 1
    @AdrianHHH i just saw your comment and this is exactly what was in my mind when i flagged the question. i should have commented instead of flagging Commented Jan 17, 2017 at 9:28
  • 2
    No. In general, you should not comment instead of flagging. There was nothing wrong with flagging this. The system worked precisely as expected. You saw something that you thought was wrong, but it ended up that the majority disagreed with you, so your flag was disputed and the question remained. Commented Jan 17, 2017 at 9:34
  • ok i understand Commented Jan 17, 2017 at 9:36

1 Answer 1

13

You shouldn't flag based solely on the presence of key words, like "best". Don't let those short-circuit your brain and prevent you from analyzing the question on its own merits.

The "primarily opinion-based" flag/closure reason states:

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.

Do you think that applies here? It is not clear me to me that it does. I suspect the other users who looked at the question after you flagged it were similarly unsure. (Note that "disputed" means it was not a moderator who evaluated your flag. It was 3–5 other experienced users who saw it in the review queue. They disagreed that the question needed to be closed.)

I agree that "better" is not the—err… best—choice of wording for this question. It would be "better" if the asker would edit the question with a more objective criterion on which to base the decision. But while that would improve the question and make it definitively not opinion-based, I don't even think the question as it currently stands is "primarily" opinion-based. It seems perfectly reasonable to expect that answers will be based on "facts, references, [and] specific expertise", rather than entirely on opinions. Imagine that he had presented the two options, and then asked what is the difference between the two. Assuming that the differences are not so numerous as to make the question "too broad", this would be a perfectly valid question, and not one whose answers are primarily based on opinions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .