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

  • SEARCH
  • Home
  • 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 7574377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:25:18+00:00 2026-05-30T16:25:18+00:00

What type is BluetoothDevice??? In this code, device works like a string (holding the

  • 0

What type is BluetoothDevice???
In this code, device works like a string (holding the UUID of the physical device) when i use it in Log() for LogCat. But I cannot assign it to a string variable (Eclipse complains that it is of type BluetoothDevice).

String action = intent.getAction();
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Log.v(TAG, "Device="+device); //DISPLAYS "Device=58:17:1C:EB:E3:A8" IN LOGCAT
String d = device; // TYPE MISMATCH!
  • How come a BluetoothDevice object is displayed by its UUID in LogCat, as if it were a string?

EDIT:
The getName() crash was caused by BluetoothDevice returning null first time, because I receive ACTION_DISCOVERY_STARTED from BluetoothAdapter. So that is solved. The mystery of why BluetoothDevice sometimes is a String remains.

  • 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-05-30T16:25:19+00:00Added an answer on May 30, 2026 at 4:25 pm

    The reason it shows in the log is that it implements toString() (more info here) which allows it to be automatically converted to a string for logging.

    If you want the hardware address as a string to use in your logic, you should use device.getAddress instead, which is in a format that is less likely to change.

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

Sidebar

Related Questions

Consider type like this one public interface IHaveGenericMethod { T1 Method<T1>(T1 parm); T2 Method<T1,T2>(T1
this type of declaration of function is valid in C but why not in
type SQLConn = val mutable private connection : string option member this.Connection with get()
Type t = typeof(bool); string typeName = t.Name; In this simple example, typeName would
Type.GetType(System.String) Is there a lookup for the aliases available somewhere? Type.GetType(string) returns null .
What type of Python objects should I use to parse files with a specific
What type of iPhone application file should I use? Before, I was trying to
The type of this function is function :: Num a => ([Char],a) -> ([Char],a)
Type mismatch. Expecting a LexBuffer<char> but given a LexBuffer<byte> The type 'char' does not
type TDelphiSignature=record Signature:array [0..3] of LongWord; Version:string; end; const DelphiSignature:array [0..2] of TDelphiSignature=( (Signature:($384F3D26,$B83782C2,$034224F3,$833A9B17);Version:'Delphi

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.