如何在Delphi中获取android版本(4.1.1、4.4.2等)
我想得到Android设备的版本。 在Java中是android.os.Build.VERSION.RELEASE,在Delphi中如何?您可以使用该记录获取有关运行应用程序的操作系统的信息如何在Delphi中获取android版本(4.1.1、4.4.2等),android,delphi,delphi-xe5,android-version,Android,Delphi,Delphi Xe5,Android Version,我想得到Android设备的版本。 在Java中是android.os.Build.VERSION.RELEASE,在Delphi中如何?您可以使用该记录获取有关运行应用程序的操作系统的信息 TOSVersion = record public type TArchitecture = (arIntelX86, arIntelX64, arARM32); TPlatform = (pfWindows, pfMacOS, pfiOS, pfAndroid, pfWinRT,
TOSVersion = record
public type
TArchitecture = (arIntelX86, arIntelX64, arARM32);
TPlatform = (pfWindows, pfMacOS, pfiOS, pfAndroid, pfWinRT, pfLinux);
public const
AllArchitectures = [arIntelX86, arIntelX64, arARM32];
AllPlatforms = [pfWindows, pfMacOS, pfiOS, pfAndroid, pfWinRT, pfLinux];
private
class var FArchitecture: TArchitecture;
class var FBuild: Integer;
class var FMajor: Integer;
class var FMinor: Integer;
class var FName: string;
class var FPlatform: TPlatform;
class var FServicePackMajor: Integer;
class var FServicePackMinor: Integer;
class constructor Create;
public
class function Check(AMajor: Integer): Boolean; overload; static; inline;
class function Check(AMajor, AMinor: Integer): Boolean; overload; static; inline;
class function Check(AMajor, AMinor, AServicePackMajor: Integer): Boolean; overload; static; inline;
class function ToString: string; static;
class property Architecture: TArchitecture read FArchitecture;
class property Build: Integer read FBuild;
class property Major: Integer read FMajor;
class property Minor: Integer read FMinor;
class property Name: string read FName;
class property Platform: TPlatform read FPlatform;
class property ServicePackMajor: Integer read FServicePackMajor;
class property ServicePackMinor: Integer read FServicePackMinor;
end;
使用代码
if TOSVersion.Check(4, 2) then
如果Android操作系统版本为4.2.2(API 17)或更高版本,则为真。可能存在重复问题。。。不是真的,我需要它用于Delphi Xe5参见Samples\MobileCodeSnippets\Delphi\DeviceInfo项目,它不仅显示了构建(如4.1.2),还显示了通用名称(“冰淇淋三明治MR1”)和设备名称(“三星Galaxy S3”)。