Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8808089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:32:00+00:00 2026-06-14T02:32:00+00:00

In my application i want to detect the BT headset or wired headset in

  • 0

In my application i want to detect the BT headset or wired headset in android.
I refer http://developer.android.com/guide/topics/connectivity/bluetooth.html code from this link.
They mention that only 3.0 and above version of android can support the BluetoothHeadset and BluetoothProfile class. Which is helpful to detect the BT headset. Now i want the same functionality in 2.2(froyo).So please any one can tell me how to do the same?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:32:02+00:00Added an answer on June 14, 2026 at 2:32 am

    You can use the 3.0 API’s in 2.2 via Reflection. But this might cause your app to work incorrectly in certain cases, behave unpredictably for some devices etc.

    If you still wanna try, see here:

    How to use BluetoothHeadset class via reflection

    A brief explanation:

    The name reflection is used to describe code which is able to inspect other code in the same system (or itself).

    For example, say you have an object of an unknown type in Java, and you would like to call a ‘doSomething’ method on it if one exists. Java’s static typing system isn’t really designed to support this unless the object conforms to a known interface, but using reflection, your code can look at the object and find out if it has a method called ‘doSomething’, and then, call it if you want to.

    So, to give you a code example of this in Java (imagine the object in question is foo) :

    Method method = foo.getClass().getMethod("doSomething", null);
    method.invoke(foo, null);
    

    In the example above, the author is trying to detect whether certain bluetooth classes and methods exist in order for the detection to work. If they exist, then they are used. If not, then your code must handle the situation by notifying the user or by some other appropriate mechanism suitable for your app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a mobile application(android) using Phonegap and I want to detect
I'm developing a mobile application in android. Here I want to detect the IP
I want to detect whether a headset is inserted or not in my android
I want to detect when an application in android has finished installation without using
In my J2ME application i want to detect network type whether it is 2G
I want to detect application name which is able to move into SD card
I want to build flash application that can detect the user eyes color and
I want to write an application that will automatically detect and fill the text
I want to detect application states and send it to the server. In the
I have an application that has two buttons, and I want to detect when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.