Android Question How to read "Device name" ?

Pravee7094

Active Member
Hi all,
How to read "Device name" of mobile phones? Not model name or manufacturer name.
want to read "Device name"

Anybody Help!

Regards
Praveen
 

Pravee7094

Active Member
Hi all,
How to read "Device name" of mobile phones? Not model name or manufacturer name.
want to read "Device name"

Anybody Help!

Regards
Praveen
(Note: where to get device name -> go to about phone and you can get device name )
 

Attachments

  • IMG_20210122_180411.jpg
    IMG_20210122_180411.jpg
    248.8 KB · Views: 70
Upvote 0

MikeSW17

Active Member
Licensed User
Hi, does the code by @MarcoRome help?
https://www.b4x.com/android/forum/threads/how-to-read-device-name.125401/

B4X:
'Add Manifest
'AddPermission("android.permission.BLUETOOTH")
'AddPermission("android.permission.BLUETOOTH_ADMIN")
'AddPermission(android.permission.ACCESS_FINE_LOCATION)

    Dim rp As RuntimePermissions
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result  Then
        Dim adapter As JavaObject
        adapter = adapter.InitializeStatic("android.bluetooth.BluetoothAdapter").RunMethodJO("getDefaultAdapter", Null)
        Log("Name device: " & adapter.RunMethod("getName", Null))    
    End If
 
Upvote 0
Top