get OS?

rfresh

Well-Known Member
Licensed User
Longtime User
What is the API call to get the OS version on the device running my app?

Thanks...
 

rfresh

Well-Known Member
Licensed User
Longtime User
Hmmm...that's not what I mean...that's the SDK ver...I'm looking for the OS version like if it's Gingerbread or Honeycomb, etc. Like 2.3.6
 
Upvote 0

Amalkotey

Active Member
Licensed User
Longtime User
Hmmm...that's not what I mean...that's the SDK ver...I'm looking for the OS version like if it's Gingerbread or Honeycomb, etc. Like 2.3.6

@rfresh:

You can use the following B4A-sub

B4X:
Sub GetOS As String
   Dim p As Phone
   Dim OS As String

   Select p.SdkVersion
     Case 2: OS = "1.1"
      Case 3: OS = "1.5"
      Case 4: OS = "1.6"
      Case 5: OS = "2.0"
      Case 6: OS = "2.0.1"
      Case 7: OS = "2.1"
      Case 8: OS = "2.2"
      Case 9: OS = "2.3"
      Case 10: OS = "2.3.x" ' 2.3.3 or 2.3.4
      Case 11: OS = "3.0"
      Case 12: OS = "3.1"
      Case 13: OS = "3.2"
      Case 14: OS = "4.0"
      Case 15: OS = "4.0.3"
      Case Else
       OS = "?"
   End Select
   
   Return OS
End Sub

or with the OSLibrary v1.40. by XverhelstX

B4X:
Sub GetOSInfo_by_OSLibrary
   Dim OSL As OperatingSystem
   Dim BootLoader As String
   Dim Release As String
   
   BootLoader = OSL.BootLoader
   Release = OSL.Release
   
   Msgbox("BootLoader: " & BootLoader & CRLF & "Release: " & Release, "GetOSInfo_by_OSLibrary")
End Sub

regards
Amalkotey
 
Last edited:
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
@NJDude - got it. Thanks to both of you. That's what I needed, a mapping of the SDK to OS.
 
Upvote 0
Top