Hostname via API

M
Markus
MVS Migros Verteilzentrum Suhr AG

Hi

All Android devices have hostnames like android-552ce9e60fd098c7.

I can confirm this with adb shell:

netprop net.hostname

I used the api query GET /devices/{deviceId}. But the attribute "HostName" is the ip address instead of the hostname.

Is there a way to read the correct hostname through the api?

Thank you and best regards

Markus

7 years ago
Android
ANSWERS
SS
Support Staff Account
7 years ago (edited 7 years ago)

Hi Markus, 

You are correct, this API will refer to the "hostname field" however we are not using the actual hostname as you have defined in your inquiry, as you would expect.  We are using the IP address to populate this field in the DB.   

I would suggest using other criteria such as IP address, IMEI or devname and the corresponding API to identify your devices depending on your use case.

Hopefully this information helps you out.

Regards,