x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Get Users Device

Hello,

Is there a way I can get the device the game is being played on?

for example can I check if the game is played on an Galaxy S4

Product Version: UE 4.8
Tags:
more ▼

asked Nov 03 '15 at 03:02 PM in C++ Programming

avatar image

Rengee
56 5 5 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Kind of hiden away:

https://github.com/EpicGames/UnrealEngine/blob/a07fbf5ed73138b7af773a6acfbe1693a234b582/Engine/Source/Runtime/Core/Public/Android/AndroidMisc.h#L60

 #if PLATFORM_ANDROID
 FString Model = FAndroidMisc::GetDeviceModel();
 #else
 FString Model = "Other";
 #endif

I placed in platfrom #if, because FAndroidMisc code won't build in other platforms (including Windows, keep that in mind) and you gonna have compiler errors, you need to create code for each platfrom.

iOS have something similar but enum based:

https://github.com/EpicGames/UnrealEngine/blob/b281c38557ad245450fe44f39b9ae28fea3cbe97/Engine/Source/Runtime/Core/Public/IOS/IOSPlatformMisc.h#L114

more ▼

answered Nov 03 '15 at 05:23 PM

avatar image

Shadowriver
37.8k 937 172 1123

avatar image trojanfoe Nov 03 '15 at 06:15 PM

Good info! Deleting my answer...

avatar image Rengee Nov 16 '15 at 12:07 PM

Great answer thanks!

avatar image Estape Oct 20 '17 at 03:01 AM

How I can call this in Blueprint?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question