<uses-permission android:name="android.permission.READ_PHONE_STATE" />
And here is the code snippet:
uses
Androidapi.JNI.Telephony, Androidapi.JNI.Provider ,
Androidapi.JNIBridge, Androidapi.JNI.GraphicsContentViewText ,
Androidapi.JNI.JavaTypes,FMX.Helpers.Android;
var
obj: JObject;
tm: JTelephonyManager;
identifier: String;
begin
obj := SharedActivityContext.getSystemService(TJContext.JavaClass.TELEPHONY_SERVICE);
if obj <> nil then
begin
tm := TJTelephonyManager.Wrap( (obj as ILocalObject).GetObjectID );
if tm <> nil then
identifier := JStringToString(tm.getDeviceId);
end;
if identifier = '' then
identifier := JStringToString(TJSettings_Secure.JavaClass.getString(SharedActivity.getContentResolver,
TJSettings_Secure.JavaClass.ANDROID_ID));
end;
There are also two other blog posts with slightly different code for retrieving the IMEI on Android with Delphi XE5 Firemonkey here and here.
Head over to the Embercadero forum to read the full thread about getting the IMEI on Android.