The first step it's a run sample from RAD Studio that named SensorInfo on your device. On the tab Biometric you can see HumanProximity. If it's true you can get access to this sensor using RTL.

Add unit System.Sensors into uses list and drop TTimer

type  TForm1 = class(TForm)    Label1: TLabel;    Timer1: TTimer;    procedure FormCreate(Sender: TObject);    procedure Timer1Timer(Sender: TObject);  private    FHumanProximity: TCustomBiometricSensor; // Declare it    { Private declarations }  public    { Public declarations }  end;var  Form1: TForm1;implementation{$R *.fmx}procedure TForm1.FormCreate(Sender: TObject);var  LSensorArray : TSensorArray;  LSensor : TCustomSensor;begin // Get the sensor list and find that we want  TSensorManager.Current.Activate();  LSensorArray := TSensorManager.Current.GetSensorsByCategory(TSensorCategory.Biometric);  for LSensor in LSensorArray do    if TCustomBiometricSensor(LSensor).SensorType = TBiometricSensorType.HumanProximity then      FHumanProximity := TCustomBiometricSensor(LSensor);end;procedure TForm1.Timer1Timer(Sender: TObject);begin // just poll it  if FHumanProximity <> nil then    Label1.Text := FHumanProximity.HumanProximity.ToString;end;end.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Jolla 宣布 Sailfish OS 已原生支持 Andr
  2. APP批量自动生成各种不同分辨率尺寸图标
  3. Android(安卓)MP3文件录制 + 声音分贝大
  4. Android(安卓)Asynctask与Handler的比较,
  5. helloPe的android项目实战之连连看—设计
  6. android ui事件处理分析
  7. 【Android语音合成TTS】国内主流引擎对比
  8. android实现登录,Login姿势对不对?
  9. android中使用startActivityForResult回
  10. Android(安卓)数据库更新 onupgrade