简体   繁体   English

通过蓝牙将.txt或Word文件从Android发送到笔记本电脑

[英]Send a .txt or word file from android to laptop over bluetooth

I am able to save my last know location in a word file in internal storage in a text file.Now every time the location is changed I have to transmit it to my laptop to give him the location intelligence. 我能够将最后一次知道的位置保存在内部文件中的Word文件中,然后再将其保存到文本文件中。现在,每次更改位置时,我都必须将其传输到笔记本电脑中以提供位置智能。

Please let me know how can I use Bluetooth/WiFi to send data to laptop whenever there is a change in location coordinates? 请告诉我,一旦位置坐标发生变化,如何使用蓝牙/ WiFi将数据发送到笔记本电脑? Definitely it needs to be automated. 绝对需要自动化。

At first you try to send data through Bluetooth from device to your laptop using Inputstream class.After that create one background service in android,implements locationlistener.like 首先,您尝试使用Inputstream类通过蓝牙将数据从设备发送到笔记本电脑。之后在android中创建一个后台服务,实现locationlistener.like

    public class MyService extends Service implements LocationListener 

Now include the data sending code in the onLocationChanged method. 现在,将数据发送代码包含在onLocationChanged方法中。

    public void onLocationChanged(Location location) {
    //Sending data from bluetooth. 
 } 

Background service is always active for watching the location updates. 后台服务始终处于活动状态,以观看位置更新。 If you want to send from WIFI,for that you have to go for middleware concept to send and receive gps location content file. 如果要从WIFI发送,则必须使用中间件概念来发送和接收gps位置内容文件。

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

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