how can access to android system level api. (ex. "BluetoothClass.PROFILE_A2DP" and others (function, const, variables))

72
April 24, 2022, at 1:00 PM
private boolean isAudio(BluetoothDevice device) {
        boolean isAudio = false;
        BluetoothClass bluetoothClass = device.getBluetoothClass();
        isAudio = (bluetoothClass.doesClassMatch(BluetoothClass.PROFILE_A2DP) ||
                bluetoothClass.doesClassMatch(BluetoothClass.PROFILE_HEADSET) ||
                bluetoothClass.doesClassMatch(BluetoothClass.PROFILE_HID))
                && !BluetoothA2dpConnection.isRemoconDevice(device);
        return isAudio;
}

This is not just a normally java's reference error question.

now i developing for android launcher application. it's not third party app. it's for provide android device's default launcher.

so i need to access to system level apis. my app is own system permissions. previous version's developer is resign already. i can't ask him. previous version launcher did access to system level apis.(ex bluetooth) but when i open this project, android stuido say to me "can not resolve method".

BluetoothClass.PROFILE_A2DP(and others) is android system level api's constants! how can i access it? and doesClassMatch method is can't access too.

BluetoothClass and BluetoothDevice Class's package is android.bluetooth (android.bluetooth.BluetoothClass) (android.bluetooth.BluetoothDevice)

Rent Charter Buses Company
READ ALSO
Is there a way to know which carrier locked the android phone using ADB

Is there a way to know which carrier locked the android phone using ADB

How to get a name of a carrier that locked the android device using adb commandsI've tried with these commands so far

84
Flutter deep links not working from browser

Flutter deep links not working from browser

I made changes in Android manifes as suggested here: https://docsflutter

100
How to correctly return api response when using retrofit in android?

How to correctly return api response when using retrofit in android?

I am trying to make an app using mvvm design and in the repository class I am calling my api using retrofitI am getting correct response from my api and I want to return that response but while returning the data from my method the data value is null

95
How to open only camera and gallery using com.theartofdev.edmodo.cropper library?

How to open only camera and gallery using com.theartofdev.edmodo.cropper library?

I want set image validation like 72 ppi resolution and max size 100k so that I used comtheartofdev

123