We are in the process of creating a multiplayer game, and to make thing’s easier for now we are using the device name to identify the player
my\_name = system.getInfo( "name" )
On iOS this works fine, and will return something along the lines of “Alan’s iPad”.
On Android however, it always returns “unknown”, so no one can tell which player they are.
My build.settings file is set up as follows, and as far as I am aware only the phone state permission should be needed to get the phone name:
settings = { orientation = { default = "landscapeRight", supported = {"landscapeRight", "landscapeLeft"} }, iphone = { plist= { UIStatusBarHidden=true, UIApplicationExitsOnSuspend = true, }, }, android = { versionCode = "1", }, androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.READ\_PHONE\_STATE" }, }
Have I missed something? Or do Android devices not have a name?
I noticed that when I first plugged my HTC Sensation into my Mac, it always showed the name as “unknown” there too.