在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,Androidapi.JNI.GraphicsContentViewText, Androidapi.JNIBridge, Androidapi.JNI.Telephony, Androidapi.JNI.JavaTypes, FMX.Helpers.Android, FMX.StdCtrls; type TForm1 = class(TForm) btn1: TButton; lbl1: TLabel; procedure btn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; TelephonyManager: JTelephonyManager; TelephonyServiceNative: JObject; implementation {$R *.fmx} procedure TForm1.btn1Click(Sender: TObject); begin TelephonyServiceNative := SharedActivityContext.getSystemService (TJContext.JavaClass.TELEPHONY_SERVICE); if Assigned(TelephonyServiceNative) then TelephonyManager := TJTelephonyManager.Wrap ((TelephonyServiceNative as ILocalObject).GetObjectID); lbl1.Text:=JStringToString(TelephonyManager.getLine1Number);//取得手机号 end; ---------------------
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论