Android Question How can you get the description of the phone?

Sergio Castellari

Active Member
Licensed User
Hello, As well as the B4A IDE can obtain the description of the device connected by B4A-Bridge. How can I get it in my application? Currently with this code I can get a unique ID, but I didn't find anything to get the description:
B4X:
Dim p As Phone
Dim DeviceID As String
DeviceID = p.GetSettings("android_id").ToUpperCase
Greetings
 

Sergio Castellari

Active Member
Licensed User
Here you go @Sergio Castellari, this will return your Android device name
B4X:
    Dim JO As JavaObject
    Log(JO.InitializeStatic("android.bluetooth.BluetoothAdapter").RunMethodJO("getDefaultAdapter", Null).RunMethod("getName", Null))
Thanks @Peter Simpson I solved it this way (they gave me the help):

B4X:
        Dim p As Phone
        Dim DeviceID As String
        DeviceID = p.GetSettings("android_id").ToUpperCase      'ID del Movil
        cNomMovil = p.Manufacturer & " " & p.Model              'Marca y Modelo
Greetings and thanks!
 
Upvote 0
Top