[英]transfer file to and fro between two android phones without using the internet
I have an application that sends an SMS from one android to another which then processes the information contained in the sms. 我有一个应用程序,可以将短信从一个机器人发送到另一个机器人,然后处理包含在短信中的信息。 The problem is that the sms can only carry a small amount of data. 问题是短信只能携带少量数据。 I want to transfer larger files (probably no more than 1Mb) between two phones but without using the internet. 我想在两部手机之间传输较大的文件(可能不超过1Mb),但不使用互联网。 I am thinking maybe GPRS, in which case can anyone give me some pointers on general coding issues with GPRS I would need to consider in order to do this and to get me started. 我在想也许是GPRS,在这种情况下,任何人都可以给我一些有关GPRS通用编码问题的提示,以便进行此操作并使我入门。 Or anyone have any other ideas on how to do this? 还是有人对如何做到这一点有其他想法?
Edit: Sorry, just to make it clearer, I need to access the mobile via some address such as its phone number to download a file and it could be anywhere, so bluetooth will not work unless it's in the vicinity (right?). 编辑:很抱歉,为了更清楚一点,我需要通过某个地址(例如手机号码)访问移动设备以下载文件,并且该文件可以在任何地方,因此除非它在附近,否则蓝牙将无法工作(对吗?)。 Perhaps something like a modem or fax will do it if there is such a thing. 如果有这样的事情,也许像调制解调器或传真之类的东西就可以做到。 I'm amazed this is so difficult to do, seems to be what mobiles were devised to do. 我很惊讶这很难做到,这似乎是手机设计的目的。
I don't think GPRS would work. 我认为GPRS无法正常工作。
It relies on mobile operator cells spread across (It costs and I think you're not allowed to send arbitrary packets). 它依赖于分散的移动运营商单元(这很费钱,我认为您不允许发送任意数据包)。
Should it work on long distances? 它应该在远距离工作吗? If not, bluetooth or WiFi direct would be the option. 如果没有,则可以选择蓝牙或WiFi Direct 。
如果您正在谈论短距离传输, 近场通信也可能是您解决方案的答案。
Use bluetooth to transfer the file 使用蓝牙传输文件
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT,mailBody);//mail body is your content
startActivity(Intent.createChooser(sharingIntent,"Share using"));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.