[转]xe6 android 使用距离传感器(Proximiry)
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)的更多相关文章
- 《Delphi XE6 android 编程入门教程》推荐
近5.6年已经没有看见关于delphi的新技术的书出来了(看来在国内delphi的使用量确实很低了), 高勇同学最近出了一本<Delphi XE6 android 编程入门教程>,上周刚拿 ...
- Delphi XE6 Android拨号函数
http://blog.sina.com.cn/s/blog_44fa172f0101rpex.html Delphi XE6 Android拨号函数 (2014-05-07 17:48:51) 转载 ...
- DEPHI XE5 XE6 ANDROID IOS开发的几点体会
DEPHI XE5 XE6 ANDROID IOS开发的几点体会 2014-09-04 20:48 1.不纠结于APK或者APP的大小.现在的客户端设备都很廉价,300元以上的新安卓设备都不在乎软件的 ...
- xe6 android控件透明度设置方法
今天才知道xe6 android控件的透明度设置方法:只需设置控件中的Opacity参数,默认为1--不透明 panel1.Opacity:=0.60;
- TSwitch 中文简繁显示支持(XE6 Android)
说明: XE6 的 TSwitch 做了很多改进,包含多语显示处理,但 XE6 似乎只认定一种中文语系「zh」,它无法处理「zh_TW」.「zh_CN」.「zh_HK」.「zh_SG」等语系,不过可以 ...
- [转]delphi xe6 android屏幕操持常亮
1) setting the Project Options, Uses Permissions, Wake lock = True 2) Adding Android.JNI.PowerManage ...
- Delphi xe6 android Popup控件的使用
1.拖放Label.button和popup控件到form 2.在structure将button1和label1拖到popup1上,然后调整布局就可以 Popup有几个重要的属性: 1.Placem ...
- delphi xe6 android ListView增加 Header或Footer 的方法
var Item1: TListViewItem;begin Item1 := ListView1.Items.Add; Item1.Purpose:=TListItemPurpose. ...
- Delphi APP 開發入門(二)Android/iOS設定,Hello World
Delphi APP 開發入門(二)Android/iOS設定,Hello World 分享: Share on facebookShare on twitterShare on google_plu ...
随机推荐
- firstModel权限问题
laravel根目录下没有 .env , 执行 cp .env.example .envstorage和bootstrap/cache 没有给写入权限, 执行 chmod -R 777 storage ...
- emqtt 3 (我要subscribe 这个topic)
这一次,主要分析client subscribe 某个topic 的处理流程. 由protocol开始 是的,还是要从protocol开始,至于为什么,之前就说过了. subscribe 类型的pac ...
- 【转】JMeter试用手记
JMeter是一款性能测试工具.个人认为与其说他是一个工具,不如说他是一个框架.因为JMeter的支持范围非常广,目前常见的需要进行性能测试的应用几乎都能应用(如:files, Servlets, P ...
- model进阶(queryset,中介模型,查询优化,extra)
queryset 方法 ############# 可切片 def queryTest(request): ret = models.Atricle.objects.all() 数据库查询 print ...
- babel-polyfill使用简介
babel-polyfill介绍 简介 使用这个插件你可随心所欲的使用es6甚至更高版本的方法,这个插件自动转码 安装 这个插件必须在你的源码运行之前运行,所以必须安装成dependency npm ...
- Flask之单元测试
5.2单元测试 为什么要测试? Web程序开发过程一般包括以下几个阶段:[需求分析,设计阶段,实现阶段,测试阶段].其中测试阶段通过人工或自动来运行测试某个系统的功能.目的是检验其是否满足需求,并得出 ...
- Java面向对象-对象的多态性
Java面向对象-对象的多态性 Java中的多态性表现: 1,方法的重载和重写(覆盖): 2,可以用父类的引用指向子类的具体实现,而且可以随时更换为其他子类的具体实现: 我们先搞个父类Animal: ...
- leetcode773
使用两种语言实现,先贴C++的 class Solution { public: vector<vector<int>> floodFill(vector<vector& ...
- 常用的软件设计模式的Java实现——让编程从野生到飞起
常用的软件设计模式的Java实现——让编程从野生到飞起_野生技术协会_科技_bilibili_哔哩哔哩 https://www.bilibili.com/video/av7596511/
- 详解Django的 select_related 和 prefetch_related 函数对 QuerySet 查询的优化
在数据库有外键的时候,使用 select_related() 和 prefetch_related() 可以很好的减少数据库请求的次数,从而提高性能.本文通过一个简单的例子详解这两个函数的作用. 1. ...