简体   繁体   English

我们可以通过蓝牙向其他Android手机发送位置请求吗?

[英]Can we send location request to other android phone via bluetooth…?

I am new to android developing world. 我是android开发世界的新手。 I am making an app where I need to send location request to people who are in my contact list. 我正在制作一个需要向我的联系人列表中的人发送位置请求的应用程序。 If the request is accepted, then he/ she will respond with current location. 如果请求被接受,则他/她将以当前位置进行回复。 While responding he will also collect neighboring device latitude and longitude via Bluetooth. 在响应时,他还将通过蓝牙收集相邻设备的经度和纬度。

Till now what I am completed is turning on neighboring device bluetooth programmatically and getting current location latitude and longitude only. 到现在为止,我完成的是以编程方式打开相邻设备的蓝牙,并仅获取当前位置的纬度和经度。

I am not getting how to send request through android application to other device and get the response. 我没有得到如何通过android应用程序将请求发送到其他设备并获得响应的方法。

Please brief me about the concept and implementation. 请简要介绍一下该概念和实现。

Try to run this example. 尝试运行此示例。 Bluetooth Chat https://mega.co.nz/#!s0kmWYKD!W2BkCRyUwtidS0DmRoWi43HgyGh72j9pqZPpklvT_eQ 蓝牙聊天https://mega.co.nz/#!s0kmWYKD!W2BkCRyUwtidS0DmRoWi43HgyGh72j9pqZPpklvT_eQ

All is inside the example. 一切都在示例中。 First you have to make a connection with the device who want to connect then change the function "sendMessage()" and putting the location in "message". 首先,您必须与要连接的设备建立连接,然后更改功能“ sendMessage()”,并将位置放入“消息”中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM