I use reflection to call the AudioManager.startBluetoothSco () method. This should be done through reflection, as it exists only in version 2.2 or higher of the SDK, but my application is built for min version 2.0. If I just compile my application without using ProGuard, everything will work fine - the method will be called correctly in 2.2, and not at all in lower versions. But when I use ProGuard, it does not work at all. I suppose there is a KEEP add-on in the ProGuard configuration that will fix this, but I cannot figure out what it should be. Here are 3 lines from my code:
AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
Method startBT = AudioManager.class.getMethod("startBluetoothSco");
startBT.invoke(am);
source
share