By default, the prompt you see when opening a terminal is defined by the variable $PS1, which usually contains:
$ echo $PS1 \h:\W \u\$
Where \h is the host name.
A DHCP server can assign a host name to a machine connecting to its network (e.g. "managed" by that server): https://askubuntu.com/a/239446/77137
So basically when you connected to that network, your host name was (temporarily) changed to android-that_alphanumeric_id. Although your local configuration is stored in /Library/Preferences/SystemConfiguration/preferences.plist (not to be edited manually) and shouldn't be affected. On a Mac you can check with:
grep -A1 LocalHostName /Library/Preferences/SystemConfiguration/preferences.plist
I got a very similar host name yesterday while connected over Wi-Fi to a university campus network. Once disconnected, my Mac got his normal/local host name back – verified before and after disconnecting by running
hostname on the command line.
It might be some commercial DHCP server (popular with in academic environments, apparently) that uses that as the default naming convention for hosts joining the network.