简体   繁体   English

使用IP地址或其他方式将文件从Java程序发送到Android App

[英]Sending file from Java program to Android App using IP address or something else

How can I send a small file of 4-16 MB to android application from a java program on computer? 如何从计算机上的Java程序向Android应用程序发送4-16 MB的小文件?

I am writing both android application to receive file and java program to nd file. 我正在写两个android应用程序来接收文件和java程序到nd文件。 Both of them are connected to internet. 他们两个都连接到互联网。

I think the simplest way is this: 我认为最简单的方法是这样的:

1 Set up apache on your server,put the file in the apache default folder,for example /var/www/html,so the file can be accessed through internet via URL; 1在服务器上设置apache,将文件放入apache的默认文件夹中,例如/ var / www / html,以便可以通过URL通过Internet访问该文件;

2 Send the URL to your app,you can use push,or socket connection; 2发送URL到您的应用程序,您可以使用推入或套接字连接;

3 In your app ,start a http connection to the file,get the file stream,and write to SD card; 3在您的应用程序中,启动与文件的http连接,获取文件流,然后写入SD卡;

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

相关问题 使用套接字在Eclipse Android程序中通过IP地址发送消息 - sending message through IP address in eclipse android program using sockets Java 实现客户端服务器 Model(使用 TCP)并从服务器发送 IP 地址并在客户端上打印出来 - Java Implementing a Client Server Model (Using TCP) and sending a IP address from server and Printing it out on Client 用java的Android IP地址 - Android IP address with java 为什么程序在从文件读取时打印其他内容? - Why the program is printing something else when reading from a file? 如何从 java 程序本身更改域的 ip 地址? - How to change the ip address for a domain from the java program itself? UDP广播-Android应用请求Java服务器IP地址 - UDP broadcasts - Android app requesting Java server IP Address Android:如何从Android应用程序获取IP地址? - Android: How can I get ip address from an android app? 使用 java 将文件从 windows 发送到 vm 时,我应该使用哪个 IP - which IP should I use when sending a file from windows to vm using java 有没有办法直接从我的 android 应用程序在浏览器中打开 IP 地址 - Is there a way to open an IP address in browser directly from my android app Java程序和ipconfig显示不同的IP地址 - Java program and ipconfig shows different IP address
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM