DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: twilight_edward
今日帖子: 18
在线用户: 16
导航: 论坛 -> 移动应用开发 斑竹:flyers,iamdream  
作者:
男 crestxa (crestxa) ★☆☆☆☆ -
普通会员
2022/11/25 20:47:46
标题:
安卓蓝牙开发求助 浏览:1015
加入我的收藏
楼主: 有没有做过delphi开发安卓蓝牙相关的,有个简单框架就可以,简单的设置和图表,可以付费,谢谢!
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2022/11/25 23:20:32
1楼: 我开发的用蓝牙的 APP,安卓和 iOS 都已经在 google play 和 app store 发布啦。

你有什么问题?免费回答技术问题。
----------------------------------------------
-
作者:
男 sensorwu (老吴) ▲▲▲△△ -
普通会员
2022/11/26 7:48:42
2楼: 楼主可参考:
https://blog.csdn.net/sensor_WU/article/details/123176368
----------------------------------------------
喜欢编程的一个DOS级程序员
作者:
男 sensorwu (老吴) ▲▲▲△△ -
普通会员
2022/11/26 8:03:41
3楼: 关于Delphi开发Android或者IOS蓝牙功能,愿意的话可以找我,不需要付费,大家共同进步,共同学xi!另外高版本的Android需要申请权限,申请权限也比较繁琐,我封装了一个控件,大家需要可以直接下载源代码(文章最后有下载地址gitee):https://blog.csdn.net/sensor_WU/article/details/125776263

还有关于android权限说明:https://blog.csdn.net/sensor_WU/article/details/125749637
----------------------------------------------
喜欢编程的一个DOS级程序员
作者:
男 sail2000 (小帆工作室) ★☆☆☆☆ -
盒子活跃会员
2022/11/26 9:28:48
4楼: 权限拉取并不复杂:

uses
  System.Permissions;//引用

在需要权限的时候:
begin
  TPermissionsService.DefaultService.RequestPermissions(
    ['android.permission.WRITE_EXTERNAL_STORAGE'],//例:拉取写储存权限
    procedure(const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray)
    begin
      if (Length(AGrantResults) = 1) and (AGrantResults[0] = TPermissionStatus.Granted) then
      begin
        //拉取权限成功
      end;
    end,
    procedure(const APermissions: TClassicStringDynArray; const APostRationaleProc: TProc)
    begin
      TDialogService.ShowMessage('需要权限',
        procedure(const AResult: TModalResult)
        begin
        //拉取权限失败
        end)
    end);
end;

完了
----------------------------------------------
delphi 是兴趣,和工作无关,即使它倒闭。又不靠它 delphi 吃饭,怕甚?
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/11/26 10:23:34
5楼: in fact, you dont needs create this layout to "require" or "show permissions message" as in RAD HELP show:

you can use many others ways, depend of necessity!
For example, you dont needs any iteration with permission (be verify or show message) then, just ask directly to system.

my "RequirePermission" on Android:

procedure TForm1.RequestPermissions(aPermissions: System.TArray<string>; aGrantResults: System.TArray<tPermissionStatus>);
begin
  PermissionsService.RequestPermissions(
  aPermissions {array of permissions},
  RequestPermissionsResultProc {procedure to analise the permission given},
  RationaleProc {procedure to verify the posssible error messages}
  );
  

if you dont need any iteration to show the error to user, then, RationaleProc can be "nil"

procedure TForm1.RationaleProc(const aPermissions: System.TArray<string>; const RationalePostProc: tProc);
begin
  Memo1.Lines.Add('RationaleProc'); // You never see this one.
end;


procedure TForm1.RequestPermissionsResultProc(const aPermissions: System.TArray<string>; const aGrantResults: System.TArray<tPermissionStatus>);
var
  i: integer;
  s: string;
begin
   RunMyProcedureAnyWay;  // no needs verify nothing just run-me
end;

the rest is with "Android O.S." it is who take care about the user accepted the permissions or not!!! not your app!!

in your project, you can just mark the permissions used in your app to generate the "Android manifest"

----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 dlfsystem (dlfsystem) ★☆☆☆☆ -
盒子活跃会员
2022/11/26 14:34:22
6楼: demo
----------------------------------------------
-
作者:
男 crestxa (crestxa) ★☆☆☆☆ -
普通会员
2022/11/26 14:48:06
7楼: 感谢大家的回复,尤其是楼上的还提出免费,让我很感动,虽然接触delphi时间比较长,但是还是很菜,只能业余爱好了,我本身工作和编程也没关系,所以断断续续的,最近我所在的地方经常“静默”,所以想再捡起来看看,现在连基本的环境都没装呢,我先找个Delphi的版本装上看看。
当然如果少量付费我也愿意,因为这个会省下我很多琢磨一些基础问题的时间。我计划就是蓝牙串口把数据送上来,然后用个图标显示,找个数据库记录,就这么见到那。如果有类似做过的可以联系我,QQ,307451030,谢谢!
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2022/11/26 23:46:24
8楼: 7 楼,你先看看 Delphi 自带的 Demo 里面关于蓝牙的 APP,把手机设置为 debug 模式,插到电脑上,把 Delphi IDE 跑起来,直接把 APP 放进去........

后面就简单了。
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/11/27 0:52:00
9楼: basically, you can use "Tethering" components on Delphi to create the communication between 2 or more devices... 
-- 1 or more app server
-- "n" apps clients (App server including)

1) TetheringManager -> to find and to do the connection!
--> just 1 needs ask the connection to "pair it" with other
-----> do the authentication, etc...

2) TetheringAppProfile -> used to send/receive datas

3) who share the "resource" use: Kind.SHARE
...who use the "resource" use: Kind.MIRROR - to reflects in other app

4) exists 2 types of "resources":
...a) Persistents:  create in "design-time"
...b) Transients : create in code-source

any way, the resources should exists on "receiver-APP", and to be used in "sender-APP", because you needs verify if the "resource" sended exists on  app-Receiver!

or be:
--- if App1 have resource named "SomeInfo", then, App2 can send any info for him!

ex.:
   App2- send a message to App1

  if TetheringAppProfile1.SendString(TetheringManager1.RemoteProfiles.First, 'ReplyText1', Edit1.Text) then...

here, "ReplyText1" is a resource that should exists on "App1" and it should be "string" type, because "Edit1.Text" is a string!


on App1:
...  resource "Persistent" -- Resources[0]Received(...)  (Resources Editor )
procedure TForm2.TetheringAppProfile1Resources0ResourceReceived(const Sender: TObject; const AResource: TRemoteResource);
var
  LText: string;
begin
  LText       := AResource.Value.AsString; // it wait for a resource "string", in this case I have just one named "ReplyText1"
end;

... resource "Transient" -- resourceReceived(...) 
procedure TForm1.TetheringAppProfile1ResourceReceived(const Sender: TObject; const AResource: TRemoteResource);
....
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行710.9375毫秒 RSS