Research on technical solutions for data transmission between computers and mobile phones based on WiFi in Android

Source: Internet
Author: User
Tags ftp connection ftp protocol

Android mobile phones and computers transmit data based on WiFi. Technically speaking, there are two main solutions:

One is implemented through the FTP protocol, and the Android mobile phone is used as the FTP server during data transmission;

One is implemented through HTTP. Android phones are used as HTTP servers during data transmission.

Therefore, the technical difficulty lies in how our app implements FTP or HTTP server functions. Of course, you can read the ftp or HTTP protocol first and implement one according to the specifications, if you have enough time and technology to pass through, another method is to seek help from the open-source community. This article focuses on analyzing several existing apps on the market for WiFi data transmission, to illustrate the selection of open source FTP or HTTP servers.


[Baidu Library]

The new version of Baidu Library implements the WiFi wireless transmission function. The interface is shown on the left. You can see that it is implemented through the FTP protocol. Enter the FTP address in the address bar of "My Computer" on the PC side to access the files on the mobile phone. The interface is shown on the right. This is an FTP virtual directory with a good structure. At the same time, because the FTP transmission function of the library is enabled in a service, you do not need to stay on this interface during file transfer, you can use other functions of this app while uploading files.


According to the analysis, Baidu Library implements WiFi wireless data transmission based on Colorado FTP, an open source FTP server.

Colorado FTP is a Java-implemented FTP server with the advantages of fast, reliable, and scalability. It is fully compatible with RFC 959 and rfc3659. However, Colorado FTP is not customized for Android devices, therefore, if you are using Android devices, you need to spend a certain amount of work on technical transformation. The Project address is http://cftp.coldcore.com/index.html, which can be used by commercial software in compliance with the lgplagreement;


[Anyview]/[Read More]

These two apps are also FTP-based wireless book transfers. They are put together because they all adopt the same technical solution, as shown in the interface. These two apps can only stay on the file transfer interface when uploading files. As long as they exit the interface, the FTP connection is interrupted and unfriendly. At the same time, after the FTP address is successfully connected in the address bar of "My Computer", the root directory of the mobile phone sdcard is entered by default, and there is no custom FTP virtual directory.



The analysis shows that both apps use swiftp to implement FTP server functions.

Swiftp is an open-source FTP server dedicated to Android devices. It is easy to integrate it into your own apps. The Project address is:

Bytes. It can be seen that anyview and developers who read these two apps use swiftp without understanding it. Fortunately, China is currently not in line with the world in open source, small companies can directly use open-source code that complies with the GPL Protocol without any concerns.


[FTP data transmission Summary]

The basic principle for implementing Wireless Transmission Based on the FTP protocol is to port an open source FTP server to the Android device and then integrate it into your own app. Therefore, the key lies in the selection of open source FTP servers. We have also seen some apps use Apache ftpserver. Apache ftpserver is a pure Java FTP service and a complete and portable FTP server engine solution, it implements underlying network operations based on the famous Mina framework. Project address: Workshop.

Overall considerations: 1) follow the Open Source protocol; 2) Difficulty of integration; 3) increase in APK size after integration; Colorado FTP is recommended.


Kingsoft sharing genie]

It seems that this app has not been updated for a long time. It is estimated that the project has been stopped, but its implementation scheme can still be referred to below for wireless transmission based on HTTP protocol, enter the HTTP address in the PC browser, as shown in. This Web interface should be implemented by a special Fe engineer. Here we can conveniently operate the SD card of the mobile phone, and the UI is still very good.


According to the analysis, Kingsoft shared genie uses jetty as the HTTP server and servlet container, but uses jetty's codehaus branch. Jetty for the codehaus branch can be found at: http://docs.codehaus.org/display/JETTY/Downloading+Jetty
.

Jetty follows two open-source protocols: Apache
Licence 2.0 and eclipse
Public License 1.0. Commercial software can be used at will.


[Virtual Data Cable]

This app implements both FTP and HTTP wireless data transmission. Its FTP method is based on swiftp. Here we only introduce the implementation of HTTP. After entering the HTTP address in the PC browser, the interface is as follows:


The virtual data cable uses jetty as the HTTP server, but uses jetty's eclipse branch. The project address is:

Http://www.eclipse.org/jetty /.


[Http data transmission Summary]

The basic principle of HTTP-based wireless data transmission is to port an open-source HTTP server to an Android device and start the HTTP server before data transmission, fe engineers may be involved in implementing their own web interfaces and corresponding functions as needed. If you really need to use the HTTP method, you can consider using jetty.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.