From Mageia wiki
Jump to: navigation, search
Attention !
Ce document est en cours de traduction !

LIEN DU DOCUMENT EN ENGLAIS : https://wiki.mageia.org/mw-en/index.php?title=File_transfer_with_Android_devices

Document outline

Objectif, cible

Cette page à pour but d'aider à configurer et mettre en place un transfert de fichier entre Mageia et un appareil android.

Cette page est adaptée aux utilisateurs n'ayant pas de connaissances approfondies mais qui connaissent le nom des fichiers qu'ils veulent transférer et qui savent installer et personnaliser Mageia et Linux. Des informations plus détaillées sont aussi présentes pour ceux qui veulent aller plus loin sur le plan technique.

État du document

Ce document a été écrit pour le bureau KDE, plus particulièrement pour le gestionnaire de fichiers Dolphin. Des informations complémentaires sur le bureau Gnome sont les bienvenues. Il existe des problèmes sur certains périphériques liés aux spécificité des différents modèles d'appareils ainsi que certaines versions modifiées d'Android. Les informations contenues dans ce document ont été vérifiées sur un petit nombre d'appareils.

Les informations de ce document ont été faites et vérifiées pour Mageia-5 et Android-5 (Lolipop).

Overview

Il y a beaucoup de moyens pour connecter un périphérique Android et un ordinateur sous Linux. Le tableau suivant récapitule les logiciels de transfert de fichiers et permet d'avoir un aperçu de leurs différentes caractéristiques.

Voici la signification des différentes colonnes du tableau :

(La plupart des noms applications Android et Mageia provient du Playstore ou de leur site officiel).
Technique : nom couramment utilisé pour décrire cette technique.
Application Android : logiciel utilisé sur le périphérique Android - si applicable.
Logiciel Linux : logiciel utilisé sur l'ordinateur sous linux - si applicable.
Périphérique actif : le périphérique qui se connecte et lance les transferts - Linux ou Android.
Opérations sur l'arborescence : "+" si la technique permet (outre le transfert de fichiers) d'effectuer des opérations sur l'arboressence du périphérique Android(par ex. renommer des fichiers, les changer de dossiers, les supprimer, ...).
Transfert de fichiers : toujours "+": Toutes les techniques listées ici permettent de transférer des fichiers.
Wifi : "+" si la méthode permet d'utiliser un réseau Wifi pour communiquer entre les 2 appareils.
USB : "+" si la méthode permet d'utiliser un câble USB pour communiquer entre les 2 appareils.
Bluetooth "+" si la méthode permeet d'utiliser le réseau Bluetooth pour communiquer en les 2 appareils.
Caractéristiques des méthodes de transfert de fichiers
Technique Application
Android
Logiciel
Linux
Périphérique
actif
Opérations sur
l'arborescence
Transfert de
fichiers
Wifi USB Blue-
tooth
KDEConnect KDE Connect KDEConnect Linux + + + +
USB mount (MTP) Linux + + +
Airdroid Airdroid Navigateur web Linux + + +
Client FTP sur Android AndFTP *) Client FTP Android - + +
Serveur FTP sur Android FTPDroid Serveur FTP Linux - + +
Transfert de fichier Bluetooth - - Linux - + +

Description des différentes méthodes

KDEConnect

Concepts et utilisation

KDEConnect émule d'un volume de stockage de données externes sous Linux : le gestionnaire de fichiers Dolphin est utilisé pour lancer les opérations de transferts par glisser-déposer, et opère sur les propriétés de fichiers ou de dossiers dans le système de fichier de l’appareil Android.

On peut connecter l’appareil android au pc linux par : Ethernet à travers un réseau Wifi ou une connexion USB câblée. Le pc linux doit être sur le même réseau local que l'appareil Android.

Pour utiliser KDEConnect, ouvrez une fenêtre sur le pc qui affiche la racine de l'appareil android ( DolphinLe panneau "places" (à gauche de la fenêtre)clic gauche sur l’icône de votre appareil ):

Transfert de fichiers

  • ouvrez une autre fenêtre de dolphin,
  • naviguez jusqu'au fichier ou dossier que vous voulez déplacer,
  • faite un glisser-déplacer de votre pc jusqu'à votre appareil android.

Opérations sur les fichiers et dossiers

  • utilisez dolphin dans les fichiers de votre appareil android de la même façon que vous navigueriez sur les fichiers de votre ordinateur.

Installation & Mise en place

Sur l'appareil android

  • Vérifiez que l'appareil android estprêt pour le transfert de fichiers (plutôt que le transfert de photos).
  • Installer l'application kde connect.
  • Pour voir les paramètres et les possibles ajustements, ouvrez l'application et allez dans le menu paramètres - mais ce n'est normalement pas nécessaire.

Sur le pc linux

add (use the "Advanced" button) the following 2 items

1714:1764/udp,
1714:1764/tcp.
  • Register the Android device(s) with KDE:
  1. KDE Control CenterHardware-section ("Overview" page)"KDE Connect" button ;
  2. if, in the left-side panel (list of available devices), the target device is marked by a red "one-way symbol" (see image below), select that device, ;
  3. than:
hit "Request pair",
the target device will emit a notification sound,
on the target device, pull down the notification bar from the top of the display,
select the pairing notification and hit "Accept".
("pairing" serves to make the software on both sides recognize each other as a valid partner and accept communication with that partner.)

The screenshot below shows the control window of KDEconnect (in the "Hardware" tab of the KDE Control Center):

KdeConnect 2.png
Registering an Android device with KDE-connect

Experience with KDEConnect

KDEConnect is a mature tool - it works nicely and is easy to use, it does not have any evident bugs.

There is one small problem: if the Android device disappears, but is kept registered, KDE (Dolphin) does not have a proper reaction.

Support files

The file $HOME/.kde4/share/config/kdeconnectrc contains configuration data: For each available Android device various caracteristics

USB mount (MTP)

Concept and usage

This method mounts the Android device like an ordinary external USB device. The implementation uses the MTP protocol ("Master Transfer Protocol"): the Android device is emulated as an ordinary external storage device, mounted on the PC. Usage is very similar to that of KDEConnect.

This method is the principal support for file transfer on PCs that use the Gnome desktop as documented here.

When the USB device gets connected, the standard USB popup window appears and announces the availability of a new USB storage device: it displays the name of the device and a list of available actions. Proceed just as you proceed with any other external USB storage device.

However, there are 2 issues to be kept in mind:

  • The popup window with possible actions contains 2 items that have similar labels - an annoying bug in the user interface of the usb device handler:
  1. one will open a File Manager window set up for exploring directories and files of cameras - not fit for handling plain files and directories; the header in the File Manager window will say Camera;
  2. the other one is the one you need, the header in the File Manager will say: mtp: > name of your device.
  • The present implementation of the MTP protocol does not support the replacing of an existing file: if an old version of a file exists, you need to manually (from your File Manager window) delete the file before a new version can be downloaded.


The two windows in the following screenshot of a KDE desktop are the result of browsing to the target directories on the Android device (upper window) and on the Linux PC (lower window).

Usbmount 2.png
Upload to a Linux PC by drag-and-drop between Dolphin windows

Installation & Setup

Android device

  • Android Lolipop already contains an implementation of MTP out of the box, no particular action is necessary.
  • But make sure that the device's USB is set up for the transfer of files (rather than photos).

Linux PC

Mageia-5 installs the packages that implement the MTP protocol at system generation, no particular action is necessary. Sometimes it is possible that it doesnt install it automatically, then you have to install the package "gvfs-mtp" manually from the Mageia repository.

Experience with USB mounted devices

For common usage, USB mounting can be considered as the method to recommend:

MTP software is, today, largely used and is "standard" software both on Mageia-5 and on Android-Lolipop: the software runs smoothly and without bugs (unless the excess item in the USB notification popup is considered a bug). This is progress with respect to earlier Android releases, where complaints on imperfections in the implementation of MTP had been published.

On the Linux side, the user interface is that used for access to external USB storage: easy to use, and no need to invest in learning yet another tool.

Airdroid

Airdroid allows to have a desktop-ish view of your smartphone in your browser. It works by connecting either via their website or locally to the app running on your smartphone.

Install airdroid via the the playstore on your smartphone and run it. You can easily authenticate using your google account, or register a separate account. Then go to their website http://web.airdroid.com/ and login there in the same way.

You will have access to your smartphone as a desktop representation in your browser, including the usage of all apps and phone calls and notifications, completely under control from your browser. Additionally there is a toolbox and file manager for easy file transfer via drag & drop.

Airdroid is free, but a premium version is also offered with even more features: https://www.airdroid.com/en/pay/

Android client FTP

Concept

This method uses an FTP client on the Android device which accesses a server on the PC. There is a long list of such clients available on Android playstore, many of them offering various flavours of FTP - for instance secure FTP, but not all of flawless quality. The leading 2 clients are presently probably the most popular servers - and both do not display publicity:

this client offers useful and important functions that go way beyond simple file transfer, such as file management and the capability for access to cloud storage; in spite of the large number of options, the user interface remains quite intuitive; nevertheless, a new user of ES File Explorer should initially set aside some time for getting familiar with managing this client,

- and probably many more. Note that many (not AndFtp and ES File explorer) display annoying publicity information. Here are some references that provide overviews on various clients:

An article that illustrates some clients
A forum thread with short comments on several clients

Usage

On the Android device, launch the FTP-client app - for instance AndFTP. Practically all FTP clients require the following parameters to be set which determine what will be transferred and where:

  • the target file or directory in local storage of the Android device (most clients offer a gui interface for navigating to that target, whereas the following 3 parameters normally need to be keyed in),
  • the IP address of the the server,
  • the name of the user owning the target directory or file on the server,
  • the password of that user.

The client may support optional parameters, for instance to use Secure FTP (SFTP) instead of FTP - they need to be selected.

The specific way of handing parameters varies between different client implementations. Some clients require all parameters to be newly selected each time a transfer is launched, other clients save parameter settings in variables - for instance to remember IP address of the servers used and allow to choose between the servers already known.

Once the parameters are defined, launch the transfer - no action is required on server.

The following Nexus-7 screenshot illustrates the last step of the upload of a file to the Linux PC - it does not illustrate that it takes 5 clicks / screens plus keying in of the user-id and password to arrive at this step:

ClientFtp 2.png
Launching a client-FTP upload (AndFTP client)

Installation & Setup

Android device

Linux PC

  1. Make sure that the personal firewall on your Mageia PC allows FTP traffic, as illustrated here.
  2. Make sure that an FTP-server is installed and running on the PC.

Experience with Android FTP clients

This method is powerful - the user can determine many details, and there is no need for installing particular software on the Linux PC.

A drawback of this method is that most Android FTP clients require the specification of parameters (IP address, user, password) to be keyed in. The default for key-in is the virtual keyboard on the device, which can be cumbersome - the use of an external keyboard (for instance connected over Bluetooth makes this much easier).

The ES File Explorer illustrates another small problem: the availability of a large number of options is a challenge to the intuitiveness of the Graphical User Interface, which is not always fully met. Referring to an article that illustrates how to use the client may be helpful.

Cloud-based file transfer

All other methods discussed in this document focus on the exchange of files between two distinct partners.

Several Android ftp clients support - in addition to this "traditional" kind of file transfer - the option of communication with cloud storage. An example is the ES File Manager, see this article as an illustration. In addition, there exist Android ftp clients that are specifically designed for communication with cloud storage. This domain is in rapid evolution - use Google to obtain an up-to-date list of software and documentation.

The operation of clients that do cloud access is quite simple: they offer functions for registering with a cloud provider and for specifying files that will be synchronised by the cloud. Once that synchronisation has been put in place, no explicitly requested file transfer actions will be necessary. The communication between the Android device and a Linux PC can be established by setting up a corresponding synchronisation from the Linux PC to the cloud.

The installation of such clients goes along the lines outlined in the preceding Section.

Android server FTP

Concept and usage

This method runs an FTP server on the Android device that can be called by FTP clients that run on the PC. Again, playstore offers the choice between serveral FTP servers (and again, the display of publicity may be an argument not to select some software):

Once the server is installed and configured, it can run more or less unattended. The user may need to determine at what time he wants the server to run and accept requests for an FTP transfer, and when the server should be stopped.

The clients on the PC will emit transfer requests - for instance, the Firefox browser could send a request to a URL that will look like "ftp://<server IP address or name>:<port number>".

Installation & Setup

Android device

Once installed, the server will display the IP address and port number it is using - this is important to note for use on the client at the PC. Furthermore, the server needs to be configured with users, their passwords and home directories. The home directory determines the part of the directory on the PC which the user can see as "his" directory, the password is used to verify that transfer requests are legitimate

Linux PC

No particular action is needed - except housekeeping of IP addresses for use by the client.

Bluetooth file transfer

Concept and usage

Bluetooth is a short-range (typically 10 meters), low-power wireless technology used for the communication between portable computing and communication devices and peripherals.

Although Bluetooth has been conceived to provide a simple and easy-to-use infrastructure for this context, the quality of the implementation and the integration into the desktop is somewhat poor.

The following discussion assumes that pairing and initialisation of the partners has been correctly accomplished. In case a file transfer fails (normally there are no error messages), the safest way go back to a well defined situation is to switch Bluetooth off on both devices and than on again, and to re-connect ( System-trayBluetooth iconPulldown menu of the target device"Connect" button ).

The concept of the current user interface is that transfers must be triggered by the sending device; the receiving device then asks the user to confirm that it is OK to receive the file.

Linux PC ⇒ Android device

  • System-trayBluetooth iconPulldown menu of the target device"Send files" button .
  • Browse to the file you want to transmit and hit "Send files".
  • Reply to the query on the target device.
  • The file will be copied to the "Download" directory, one level below the root of the visible directory tree of the device.

Android device ⇒ Linux PC

  • On the Android device, open the file you want to transmit.
  • In the "Settings" menu (three-dot icon) of the opened file, activate the Bluetooth item to transmit the file.
  • The file will be stored in the directory selected for the storage of files received via Bluetooth (see below).

If the "Settings" menu does not have a "Bluetooth" item, you need to install an "app" for the transmission via Bluetooth - for instance Bluetooth File Transfer.

There exists a confusing multitude of ways to launch Bluetooth file-transfer actions - the described procedures have been tested to work and should not lead into dead-end situations.

Installation & Setup

Except - possibly - the app for transmitting files from the Android device, no particular software needs to be installed for the communication via Bluetooth.

The principal setup action consists in "pairing" the Linux PC with each individual Bluetooth device: the Bluetooth interface in Linux associates and memorizes for each device a name and a pre-shared key, and vice versa. Pairing can be initialised from either side:

  • the active side starts with a scanning operation, detecting all available nearby Bluetooth devices - which requires the passive side to be in "discoverable" state during the scan;
  • the user than selects a target device from the list of names of available devices and requires it to be paired;
  • a passkey is then proposed for the mutual authentication at device initialisation and for encryption during the exchange of data;
  • pairing is completed for each device by the user acknowledging the key on both sides.

It may also be necessary to configure a target directory in the file system of the PC where files received from the Android device will be stored:

  • System-trayBluetooth icon"Configure Bluetooth" button"File Transfers" tab ;
  • activate the "Receive files:" checkbutton;
  • browse to the target directory ("Save files in:" ...);

KDE-specific setup

KDE offers an easy-to-use alternative for doing these operations:

  • launch the KDE Bluetooth manager in the KDE Control Center, resp. its "Network and Connectivity" tab;
  • check the "Enable KDE Bluetooth integration" checkbutton;
  • to discover and pair new Bluetooth devices, hit the "Add Device..." button (right bottom of the device list) and pursue the pairing of new devices;
  • to control the settings of a specific device, double-click the device in the list of known devices; in the window that then pops up, select the desired option.

Experience with Bluetooth file transfer

As already mentioned, Bluetooth file transfer has some inconvenients: (1) its integration into the desktop environment is somewhat clumsy and lacks intuitivity (the style of the user interface is different from what the user of the desktop environment expects), (2) it is easy to "get lost" and end up in a situation where the file transfer has failed and the Bluetooth interface needs to be re-initialised, (3) the other methods offer better functionality, (4) in case of failure, error messages are missing or do not provide diagnostic information.

The strength of Bluetooth is its simplicity - it can be launched out of an Android application that has opened a file, respectively directly from from the taskbar of a Linux desktop: good for doing occasional one-off transfers.