How do I get current devices BlueTooth Friendly Name?

BarrySumpter

Active Member
Licensed User
Longtime User
How do I get current devices BlueTooth Friendly Name?

Not trying to connect to anything.
Not trying to find another BT device.
Not trying to find paired devices.

I just want to retrieve and display my current devices BT name.

Any help would be greatly apprecieated.


I want to add my BT name to this:

B4X:
'Activity module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)

Dim MyLan As ServerSocket
MyLan.Initialize(0, "")
MyLan.Listen

Dim p As Phone

myDevice = "Device/phone ID: " & p.GetSettings("android_id")

Dim myWifi As ABWifi 
    myWifi.ABLoadWifi()
    mymac = "Mac Address: " & myWifi.ABGetCurrentWifiInfo().MacAddress 

Msgbox("ipAdddress: " & MyLan.GetMyIP & CRLF & myDevice & CRLF & mymac, "")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

BarrySumpter

Active Member
Licensed User
Longtime User
Serial.name

B4X:
'Activity module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)

Dim MyLan As ServerSocket
MyLan.Initialize(0, "")
MyLan.Listen

Dim p As Phone

myDevice = "Device/phone ID: " & p.GetSettings("android_id")

Dim myWifi As ABWifi 
    myWifi.ABLoadWifi()
    mymac = "Mac Address: " & myWifi.ABGetCurrentWifiInfo().MacAddress 

    Dim Serial1 As Serial
    Serial1.Initialize("serial1")
  
    Dim BTName As String
    BTName = "BTName: " & Serial1.Name



Msgbox("ipAdddress: " & MyLan.GetMyIP & CRLF & myDevice & CRLF & mymac & CRLF & BTName, "")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 
Last edited:
Upvote 0
Top