Get Android Device and OS Info in Firemonkey

2019-03-04 10:06发布

问题:

I know how to get app version, package name, udid for both Android and iOS But for iOS I can get more info.

Code below returns model name, device name, os type and os version:

string(Device.model.UTF8String);//Model name
string(Device.name.UTF8String);//Device name
string(Device.systemName.UTF8String);//Os type
string(Device.systemVersion.UTF8String);//Os version

Is it also possible to get this info For Android? I'm currently working in Delphi 10 Seattle.

回答1:

I found what i'm looking for. With the following code i can get model name of android phone and android version:

JStringToString(TJBuild.JavaClass.MODEL);//Model name
JStringToString(TJBuild_VERSION.JavaClass.RELEASE);//Os Version