x


Get Android Device Name

I am trying to pass the Android Device name to a GUIText box so that people who do not wish to put their name in to the player name box will be shown as something other than a default text.

I have the Java script for the command but I cannot get UnityScript to accept it.

The Java is android.os.Build.MODEL;

If anyone can help translate this to UnityScript I will give you a hug.

more ▼

asked Feb 05 '12 at 01:55 AM

mabit gravatar image

mabit
146 12 19 22

There is a similar question asked in the forums: http://forum.unity3d.com/threads/83294-Getting-phone-model-and-droid-version

I couldn't find anything in the scripting reference, but this is the closest thing to what we need to use to get that. http://unity3d.com/support/documentation/ScriptReference/AndroidJavaObject.Call.html

Feb 05 '12 at 08:16 AM Aram Azhari
(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

I found the line of code.

SystemInfo.deviceModel; - for model name

SystemInfo.deviceName; - for the user set name

more ▼

answered Feb 06 '12 at 07:03 AM

mabit gravatar image

mabit
146 12 19 22

That's amazing. Thanks for letting us know too.

Feb 06 '12 at 07:20 AM Aram Azhari
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2473
x313
x143

asked: Feb 05 '12 at 01:55 AM

Seen: 3009 times

Last Updated: Feb 06 '12 at 07:20 AM