How can you get the name of the phone?
Moderator: Martin
How can you get the name of the phone?
Hey Martin, is there a way to get the name of the phone automagic is running on? There has to be a command you can execute, similar to the way you got the IP address of the phone.
Re: How can you get the name of the phone?
Hi,
What do you mean by name of the phone, the device model?
A lot of information about the device can be found in text file /system/build.prop. You could use an action Init Variable Text File to read the entire file and use regular expressions or substring functions in a script to extract the relevant part. Reading this file is also a good starting point to see what kind of values are available. On a Nexus 5 this file looks about like this:
Regards,
Martin
What do you mean by name of the phone, the device model?
A lot of information about the device can be found in text file /system/build.prop. You could use an action Init Variable Text File to read the entire file and use regular expressions or substring functions in a script to extract the relevant part. Reading this file is also a good starting point to see what kind of values are available. On a Nexus 5 this file looks about like this:
It's much easier to read one single value with command getprop, for example using action Execute Command: getprop ro.product.model. The value (Nexus 5 in my case) can be accessed in variable stdout (if you use the default variable name).# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=KTU84P
ro.build.display.id=KTU84P
ro.build.version.incremental=1227136
ro.build.version.sdk=19
ro.build.version.codename=REL
ro.build.version.release=4.4.4
ro.build.date=Fri Jun 13 07:05:49 UTC 2014
ro.build.date.utc=1402643149
ro.build.type=user
ro.build.user=android-build
ro.build.host=kpfj3.cbf.corp.google.com
ro.build.tags=release-keys
ro.product.model=Nexus 5
ro.product.brand=google
ro.product.name=hammerhead
ro.product.device=hammerhead
ro.product.board=hammerhead
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=LGE
...
Regards,
Martin
Re: How can you get the name of the phone?
Perfect. Just what I was looking for. Thanks.
Re: How can you get the name of the phone?
Any idea on how to get the Bluetooth MAC Address of the phone itself?
Re: How can you get the name of the phone?
Action Init Variable System Setting with Category Secure and Name bluetooth_address should work.