How to determine if the device has a 3.5 mm audio jack?

I read a lot of posts and articles, but did not find anything related to my requirement. Many new Android devices come without a built-in headphone jack, and I don’t need to deal with these devices.

Through PackageManger I could only detect the AUDIO_OUTPUT function.

Is there an effective way by which I can check if there is a 3.5 mm audio jack in the device?

+5
source share
1 answer

I don’t think the application can determine if the device has a 3.5 mm audio jack.

From: https://source.android.com/devices/audio/usb#hostApplications

line:

There are no APIs specific to USB digital audio.

You should not hope, especially in the same document that was previously mentioned when talking about TRS Mini (audio jack) and USB Audio:

Note. This is an artificial comparison, since a real Android device probably has both options.

Perhaps this was true when the document was first written, but, as you have already noted, it is now less guaranteed.

Scanning Android compatibility documentation is displayed on Android CDD Section 7.8.2 Audio so that there is no difference between the 3.5 mm audio jack and the USB audio connection.

One suggestion is to send an Android Issue Tracker feature request with a detailed use case regarding why the inherited headphone jack should have a feature flag.

+2
source

Source: https://habr.com/ru/post/1275372/


All Articles