Android Open Source - lamp Bluetooth Device Comparator

From Project

Back to project page lamp.


The source code is released under:

GNU General Public License

If you think the Android project lamp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package cz.tomsuch.lampicka.util;
// ww  w  .j  a  va2  s  . c  o  m
import java.util.Comparator;

import android.bluetooth.BluetoothDevice;

 * Comparator specially for BluetoothDevice instances
 * */
public class BluetoothDeviceComparator implements Comparator<BluetoothDevice> {

  public int compare(BluetoothDevice lhs, BluetoothDevice rhs) {
    String l = lhs.getName() == null ? "" : lhs.getName();
    String r = rhs.getName() == null ? "" : rhs.getName();
    return l.compareTo(r);


Java Source Code List