skip to Main Content

Null check operator used on a null value when calling a function from another class – Flutter

I have a class called DataCollectionPage where I have the following function in the initState function: void establishConnection (){ BluetoothConnection.toAddress(widget.server!.address).then((connection) { Utils.showSnackBar2("Successfully connected to your device"); this.connection = connection; setState(() { isConnecting = false; isDisconnecting = false; }); this.connection!.input!.listen(_onDataReceived).onDone(() {…

VIEW QUESTION

Android Studio – BLUETOOTH_CONNECT, BLUETOOTH_SCAN Missing permissions

enter image description here There seems to be a problem with 'BLUETOOTH_CONNECT and 'BLUETOOTH_SCAN'. But I have already made a declaration. `<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" > <!-- Request legacy Bluetooth permissions on older devices. --> <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30"…

VIEW QUESTION

Android Studio – Show connected bluetooth devices Kotlin

I can only find how to show paired bluetooth devices and not the current connected bluetooth devices. This is the code to show paired: val blueToothManager=applicationContext.getSystemService(BLUETOOTH_SERVICE) as BluetoothManager val bluetoothAdapter=blueToothManager.adapter var pairedDevices = bluetoothAdapter.bondedDevices var data:StringBuffer = StringBuffer() for(device: BluetoothDevice…

VIEW QUESTION
Back To Top
Search