All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.nordicsemi.android.ble.LegacyBleManager Maven / Gradle / Ivy

There is a newer version: 2.9.0-beta02
Show newest version
package no.nordicsemi.android.ble;

import android.content.Context;
import android.os.Handler;

import androidx.annotation.NonNull;

/**
 * When migrating from BLE Manager 2.1.1 to 2.2.0, the BleManager is no longer a template class.
 * Callbacks need to be passed in other way, e.g. using LiveData, RxJava or with a callback,
 * but the BleManager will not hold the callbacks reference.
 * 

* To make the migration easier, this class behaves the same way as the old BleManager. * Replace the base class of your manager to LegacyBleManager. * @param the callbacks interface. */ @SuppressWarnings({"WeakerAccess", "unused", "deprecation"}) @Deprecated public abstract class LegacyBleManager extends BleManager { protected E mCallbacks; public LegacyBleManager(@NonNull final Context context) { super(context); } public LegacyBleManager(@NonNull final Context context, @NonNull final Handler handler) { super(context, handler); } @Override public void setGattCallbacks(@NonNull final BleManagerCallbacks callbacks) { super.setGattCallbacks(callbacks); //noinspection unchecked mCallbacks = (E) callbacks; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy