1

I have an IoT project that has to identify my RaspberryPI (which has Android Things OS) over the local network.

A good way to do this is by using the Multicast DNS (mDNS) that Android Things broadcasts as Android.local.

The question is: can I change the Android.local to somethingelse.local so that I dont have any conflicts ?

I know it is possible using a Linux OS, as showed here. Can I do the same on Android Things ?

Thanks in advance!

Geraldo Neto
  • 3,670
  • 1
  • 30
  • 33
  • 1
    See: https://stackoverflow.com/questions/13796841/how-to-change-android-device-name-used-by-nsdmanager – Morrison Chang Jun 19 '18 at 04:44
  • @MorrisonChang, thanks for replying! Even though the question is similar, it is related to Android phones. My doubt is on Android Things OS running on RaspberryPI, which might give us more possibilities. – Geraldo Neto Jun 19 '18 at 14:50
  • Would look here for APIs https://developer.android.com/things/versions/things-1.0 and things not supported: https://developer.android.com/things/versions/things-1.0-changes#top_of_page – Morrison Chang Jun 19 '18 at 16:20

1 Answers1

1

I know Android Things is no longer supported but still... I found solution: You can set hostname over ADB:

adb connect x.x.x.x  # where x.x.x.x is ip address of your device                                                   
adb root
adb remount
adb shell
su
cd system
echo 'net.hostname=newHostName' >> build.prop 

echo 'net.hostname=newHostName' >> build.prop appends new line to build.prop file.. if you wish to rename again you need to remove this line before

MatR
  • 225
  • 1
  • 12