0

I am trying to use RxAndroidBle to scan for devices. All the examples I found seem to use java lambda expression. Do I need java 8 with android studio to use the RxAndroidBle library? How can I run the below code with out lamda expressions?

Subscription scanSubscription = rxBleClient.scanBleDevices(
        new ScanSettings.Builder()
            // .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) // change if needed
            // .setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES) // change if needed
            .build()
        // add filters if needed
)
    .subscribe(
        scanResult -> {
            // Process scan result here.
        },
        throwable -> {
            // Handle an error here.
        }
    );
amanda45
  • 535
  • 10
  • 29

1 Answers1

0

No. You don't have to use Java8. Just use interfaces provided by RxJava in order to subscribe. Look at Action1, 2, 3... interfaces

pawel.urban
  • 1,031
  • 8
  • 10