Difference between revisions of "Application:getDeviceInfo"

From GiderosMobile
m (Text replacement - "</source" to "</syntaxhighlight")
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Application|Application]]<br/>
 
=== <translate>Description</translate> ===
 
<translate><br />
 
Returns information about device.<br />
 
<br />
 
- For iOS, returns 5 values: &quot;iOS&quot;, iOS version, device type, user interface idiom and device model<br />
 
- For Android, returns 4 values: &quot;Android&quot;, Android version, manufacturer and model information<br />
 
- For Windows returns 1 value: &quot;Windows&quot;<br />
 
- For Mac OS X returns 1 value: &quot;Mac OS&quot;<br />
 
- For Win32 returns 1 value: &quot;Win32&quot;<br />
 
<br />
 
  
''iOS values''
+
'''Available since:''' Gideros 2011.6<br/>
1st value -> "iOS"
+
'''Class:''' [[Application]]<br/>
2nd value -> [[UIDevice currentDevice] systemVersion]
 
3rd value -> [[UIDevice currentDevice] model]
 
4th value -> UI_USER_INTERFACE_IDIOM() (as "iPhone" or "iPad")
 
5th value -> hw.machine.
 
Here are the possibilities:
 
iPhone1,1 -> iPhone 1G, M68
 
iPhone1,2 -> iPhone 3G, N82
 
iPhone2,1 -> iPhone 3GS, N88
 
iPhone3,1 -> iPhone 4/AT&T, N89
 
iPhone3,2 -> iPhone 4/Other Carrier?, ??
 
iPhone3,3 -> iPhone 4/Verizon, TBD
 
iPhone4,1 -> (iPhone 4S/GSM), TBD
 
iPhone4,2 -> (iPhone 4S/CDMA), TBD
 
iPhone4,3 -> (iPhone 4S/???)
 
iPhone5,1 -> iPhone Next Gen, TBD
 
iPhone5,1 -> iPhone Next Gen, TBD
 
iPhone5,1 -> iPhone Next Gen, TBD
 
 
iPod1,1 -> iPod touch 1G, N45
 
iPod2,1 -> iPod touch 2G, N72
 
iPod2,2 -> Unknown, ??
 
iPod3,1 -> iPod touch 3G, N18
 
iPod4,1 -> iPod touch 4G, N80
 
 
iPad1,1 -> iPad 1G, WiFi and 3G, K48
 
iPad2,1 -> iPad 2G, WiFi, K93
 
iPad2,2 -> iPad 2G, GSM 3G, K94
 
iPad2,3 -> iPad 2G, CDMA 3G, K95
 
iPad3,1 -> (iPad 3G, WiFi)
 
iPad3,2 -> (iPad 3G, GSM)
 
iPad3,3 -> (iPad 3G, CDMA)
 
iPad4,1 -> (iPad 4G, WiFi)
 
iPad4,2 -> (iPad 4G, GSM)
 
iPad4,3 -> (iPad 4G, CDMA)
 
 
i386, x86_64 -> iPhone Simulator
 
  
''Android values''
+
=== Description ===
1st value -> "Android"
+
Returns information about device.
2nd value -> android.os.Build.VERSION.SDK_INT
+
<syntaxhighlight lang="lua">
3rd value -> android.os.Build.MANUFACTURER
+
(varies) = application:getDeviceInfo()
4th value -> android.os.Build.MODEL</translate>
+
</syntaxhighlight>
<source lang="lua">
+
 
(varies) = Application:getDeviceInfo()
+
 
</source>
+
* for iOS, returns 5 values: "iOS", iOS version, device type, user interface idiom and device model<br/>
=== <translate>Return values</translate> ===
+
* for Android, returns 4 values: "Android", Android version, manufacturer and model information<br/>
'''<translate>Returns</translate>''' (varies) <translate>Information about device, returned informations varies depending on platform</translate><br/>
+
* for Windows returns 1 value: "Windows"<br/>
 +
* for Mac OS X returns 1 value: "Mac OS"<br/>
 +
* for Win32 returns 1 value: "Win32"<br/>
 +
* for HTML5 returns 2 values: "Web", Browser ID string<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (varies) information about device, returned informations varies depending on platform</br>
 +
 
 +
==== iOS values ====
 +
1st value -> "iOS"<br/>
 +
2nd value -> [[UIDevice currentDevice] systemVersion]<br/>
 +
3rd value -> [[UIDevice currentDevice] model]<br/>
 +
4th value -> UI_USER_INTERFACE_IDIOM() (as "iPhone" or "iPad")<br/>
 +
5th value -> hw.machine. <br/>
 +
 
 +
'''Here are the possibilities''':<br/>
 +
iPhone1,1 -> iPhone 1G, M68<br/>
 +
iPhone1,2 -> iPhone 3G, N82<br/>
 +
iPhone2,1 -> iPhone 3GS, N88<br/>
 +
iPhone3,1 -> iPhone 4/AT&T, N89<br/>
 +
iPhone3,2 -> iPhone 4/Other Carrier?, ??<br/>
 +
iPhone3,3 -> iPhone 4/Verizon, TBD<br/>
 +
iPhone4,1 -> (iPhone 4S/GSM), TBD<br/>
 +
iPhone4,2 -> (iPhone 4S/CDMA), TBD<br/>
 +
iPhone4,3 -> (iPhone 4S/???)<br/>
 +
iPhone5,1 -> iPhone Next Gen, TBD<br/>
 +
iPhone5,1 -> iPhone Next Gen, TBD<br/>
 +
iPhone5,1 -> iPhone Next Gen, TBD<br/>
 +
 
 +
iPod1,1 -> iPod touch 1G, N45<br/>
 +
iPod2,1 -> iPod touch 2G, N72<br/>
 +
iPod2,2 -> Unknown, ??<br/>
 +
iPod3,1 -> iPod touch 3G, N18<br/>
 +
iPod4,1 -> iPod touch 4G, N80<br/>
 +
 
 +
iPad1,1 -> iPad 1G, WiFi and 3G, K48<br/>
 +
iPad2,1 -> iPad 2G, WiFi, K93<br/>
 +
iPad2,2 -> iPad 2G, GSM 3G, K94<br/>
 +
iPad2,3 -> iPad 2G, CDMA 3G, K95<br/>
 +
iPad3,1 -> (iPad 3G, WiFi)<br/>
 +
iPad3,2 -> (iPad 3G, GSM)<br/>
 +
iPad3,3 -> (iPad 3G, CDMA)<br/>
 +
iPad4,1 -> (iPad 4G, WiFi)<br/>
 +
iPad4,2 -> (iPad 4G, GSM)<br/>
 +
iPad4,3 -> (iPad 4G, CDMA)<br/>
 +
 
 +
i386, x86_64 -> iPhone Simulator<br/>
 +
 
 +
==== Android values ====
 +
1st value -> "Android"<br/>
 +
2nd value -> android.os.Build.VERSION.SDK_INT<br/>
 +
3rd value -> android.os.Build.MANUFACTURER<br/>
 +
4th value -> android.os.Build.MODEL<br/>
 +
 
 +
{{Application}}

Latest revision as of 16:56, 12 July 2023


Available since: Gideros 2011.6
Class: Application

Description

Returns information about device.

(varies) = application:getDeviceInfo()


  • for iOS, returns 5 values: "iOS", iOS version, device type, user interface idiom and device model
  • for Android, returns 4 values: "Android", Android version, manufacturer and model information
  • for Windows returns 1 value: "Windows"
  • for Mac OS X returns 1 value: "Mac OS"
  • for Win32 returns 1 value: "Win32"
  • for HTML5 returns 2 values: "Web", Browser ID string

Return values

Returns (varies) information about device, returned informations varies depending on platform

iOS values

1st value -> "iOS"
2nd value -> [[UIDevice currentDevice] systemVersion]
3rd value -> [[UIDevice currentDevice] model]
4th value -> UI_USER_INTERFACE_IDIOM() (as "iPhone" or "iPad")
5th value -> hw.machine.

Here are the possibilities:
iPhone1,1 -> iPhone 1G, M68
iPhone1,2 -> iPhone 3G, N82
iPhone2,1 -> iPhone 3GS, N88
iPhone3,1 -> iPhone 4/AT&T, N89
iPhone3,2 -> iPhone 4/Other Carrier?, ??
iPhone3,3 -> iPhone 4/Verizon, TBD
iPhone4,1 -> (iPhone 4S/GSM), TBD
iPhone4,2 -> (iPhone 4S/CDMA), TBD
iPhone4,3 -> (iPhone 4S/???)
iPhone5,1 -> iPhone Next Gen, TBD
iPhone5,1 -> iPhone Next Gen, TBD
iPhone5,1 -> iPhone Next Gen, TBD

iPod1,1 -> iPod touch 1G, N45
iPod2,1 -> iPod touch 2G, N72
iPod2,2 -> Unknown, ??
iPod3,1 -> iPod touch 3G, N18
iPod4,1 -> iPod touch 4G, N80

iPad1,1 -> iPad 1G, WiFi and 3G, K48
iPad2,1 -> iPad 2G, WiFi, K93
iPad2,2 -> iPad 2G, GSM 3G, K94
iPad2,3 -> iPad 2G, CDMA 3G, K95
iPad3,1 -> (iPad 3G, WiFi)
iPad3,2 -> (iPad 3G, GSM)
iPad3,3 -> (iPad 3G, CDMA)
iPad4,1 -> (iPad 4G, WiFi)
iPad4,2 -> (iPad 4G, GSM)
iPad4,3 -> (iPad 4G, CDMA)

i386, x86_64 -> iPhone Simulator

Android values

1st value -> "Android"
2nd value -> android.os.Build.VERSION.SDK_INT
3rd value -> android.os.Build.MANUFACTURER
4th value -> android.os.Build.MODEL