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.

[转]xe6 android 使用距离传感器(Proximiry)的更多相关文章

  1. 《Delphi XE6 android 编程入门教程》推荐

    近5.6年已经没有看见关于delphi的新技术的书出来了(看来在国内delphi的使用量确实很低了), 高勇同学最近出了一本<Delphi XE6 android 编程入门教程>,上周刚拿 ...

  2. Delphi XE6 Android拨号函数

    http://blog.sina.com.cn/s/blog_44fa172f0101rpex.html Delphi XE6 Android拨号函数 (2014-05-07 17:48:51) 转载 ...

  3. DEPHI XE5 XE6 ANDROID IOS开发的几点体会

    DEPHI XE5 XE6 ANDROID IOS开发的几点体会 2014-09-04 20:48 1.不纠结于APK或者APP的大小.现在的客户端设备都很廉价,300元以上的新安卓设备都不在乎软件的 ...

  4. xe6 android控件透明度设置方法

    今天才知道xe6 android控件的透明度设置方法:只需设置控件中的Opacity参数,默认为1--不透明 panel1.Opacity:=0.60;

  5. TSwitch 中文简繁显示支持(XE6 Android)

    说明: XE6 的 TSwitch 做了很多改进,包含多语显示处理,但 XE6 似乎只认定一种中文语系「zh」,它无法处理「zh_TW」.「zh_CN」.「zh_HK」.「zh_SG」等语系,不过可以 ...

  6. [转]delphi xe6 android屏幕操持常亮

    1) setting the Project Options, Uses Permissions, Wake lock = True 2) Adding Android.JNI.PowerManage ...

  7. Delphi xe6 android Popup控件的使用

    1.拖放Label.button和popup控件到form 2.在structure将button1和label1拖到popup1上,然后调整布局就可以 Popup有几个重要的属性: 1.Placem ...

  8. delphi xe6 android ListView增加 Header或Footer 的方法

    var  Item1: TListViewItem;begin    Item1 := ListView1.Items.Add;    Item1.Purpose:=TListItemPurpose. ...

  9. Delphi APP 開發入門(二)Android/iOS設定,Hello World

    Delphi APP 開發入門(二)Android/iOS設定,Hello World 分享: Share on facebookShare on twitterShare on google_plu ...

随机推荐

  1. build RTK on ubuntu 16.04

    RTK-1.4.0 InsightToolkit-4.12.2 ./cmake/nvcc-check.cmake line:86 commentout as #message(FATAL_ERROR ...

  2. linux用rdate命令实现同步时间

    用rdate命令实现同步时间 前两天说到用ntp时间服务器和ntpdate命令同步时间,今天简单记录下用rdate同步时间 http://blog.csdn.net/wyzxg/archive/201 ...

  3. Vue.js:安装

    ylbtech-Vue.js:安装 1.返回顶部 1. Vue.js 安装 1.独立版本 我们可以在 Vue.js 的官网上直接下载 vue.min.js 并用 <script> 标签引入 ...

  4. 网络监控之一:netstat命令

    netstat命令用于显示与IP.TCP.UDP和ICMP协议相关的统计数据,一般用于检验本机各端口的网络连接情况.netstat是在内核中访问网络及相关信息的程序,它能提供TCP连接,TCP和UDP ...

  5. explain解析

    MySQL执行计划调用方式执行计划包含的信息执行计划显示内容解读MySQL执行计划的局限MySQL5.6支持OPTIMIZER_TRACE 1.什么是归并排序?将已有序的子序列合并,得到完全有序的序列 ...

  6. Informatica PowerCenter下载地址

    https://edelivery.oracle.com/EPD/Download/get_form?egroup_aru_number=12854075

  7. Deep Learning 学习笔记(7):神经网络的求解 与 反向传播算法(Back Propagation)

    反向传播算法(Back Propagation): 引言: 在逻辑回归中,我们使用梯度下降法求参数方程的最优解. 这种方法在神经网络中并不能直接使用, 因为神经网络有多层参数(最少两层),(?为何不能 ...

  8. LinqHelper连接数据库配置

    LinqHelper连接数据库配置/// <summary> /// Linq通用数据访问类 /// 指定TDataBase来代替后面要使用的数据上下文(指代) /// where:说明指 ...

  9. Mybatis工具Generator

    转自:http://www.cuiyongzhi.com/post/36.html MyBatis Generator(以下简称为MBG),可以逆向生成持久层的基本代码,而且mybatis的实现方案比 ...

  10. Hadoop IO 特性详解(1)

    本文结合hadoop : the definitive guide精心而作,包含作者的心血,希望可以帮助大家理解一点hdfs的皮毛,足矣.(charles@xingbod.cn) hadoop本身自带 ...