⬆️ ⬇️

Synchronize your smartphone with a computer over the air

image

It was an unpleasant surprise for me that for Android there is no ready-made solution for automatically synchronizing files with a computer over the air. Even on my old SE W810i, it was possible to turn on bluetooth, run the program, and it immediately automatically downloaded new photos, messages, etc. to the computer, and also sent fresh music in the opposite direction.



The review of applicants for "the ready decision" and my own implementation - under a cat.



First outline the desired functionality:

1. So that all new photos are uploaded to the specified folder.

2. So that you can make a folder on your computer where you can record some files, and after synchronization they will end up in the specified folder of the phone (for example, uploading fresh music to the phone).

')

Now you can go on a search.



Contenders for the "turnkey solution"





Dropbox

(Windows, Mac OS, Linux)





Unfortunately, Dropbox for Android does not support automatic data synchronization. You have to upload each photo manually. There is hope for a third-party client of the Droidbox , the author of which promised to implement it, but, firstly, so far it remains only a promise, and secondly, the application is paid. Does not fit.



Sugarsync

(Windows, Mac OS)





Identical to Dropbox'u service called SugarSync has its own application for Android . But if I could notice a tiny link to register a free account (which can hold 2 gigabytes), then I couldn’t get the client to connect to the server with their server either via WI-FI or GPRS. Unfortunately, according to the description on the site, it is not very clear whether there is an automatic synchronization function, so the question remains open.



The missing sync

(Windows, Mac OS)





Judging by the description on the site, this application can do everything that I need (and even more). Among the declared functions are the synchronization of browser bookmarks, contacts, notes, call history, SMS, automatic conversion and video upload, and much more. But the program is not free and costs $ 39.95, which is obviously expensive for me. Besides, having walked on foreign forums, I read quite a few negative reviews about this program.



Doubletwist

(Windows, Mac OS)





The program that TechCrunch loudly described "iTunes for Android", if you believe the quote on the site. The idea is able to synchronize music, video and pictures. She did not identify my phone, and in the list among possible devices from familiar names there was only Windows Mobile.



But the main problem is that it connects to the computer via USB-cable and works with it as with a flash drive. With this approach, you can generally use any program for automatic data backup to synchronize, because our goal was to synchronize over the air. In addition, it can automatically work only in the direction “computer → phone” and cannot synchronize any other formats besides the above.



Own way



For myself, I solved this problem in the following way: an FTP server rises on the phone, and a program starts up on the computer, which automatically goes into it and does all the manipulations I need.



What do you want?



1. SwiFTP is a free unpretentious FTP server that allows you to set up a username and password for access, a root folder and a server accessibility zone (WI-FI and / or GPRS / 3G).





(alternatives: FTPServer and On Air )



2. WI-FI router (in the settings of the DHCP server, bind the IP to the MAC address of the phone - it is necessary that the computer always clearly knows what ip it needs to connect to FTP), or the firmware and the Wireless Tether for Root Users program, which Makes the phone a WI-FI access point (hello to the owners of the Nexus One with Froyo on board, which has native support for WI-FI tethering!).



3. WinSCP program

- FTP-client, which has the function of synchronization and supports automation through scripts.



What to do?



First, we install SwiFTP, go into the settings, specify the username and password at will, check the box “Accept connections from WI-FI”. We save. Start the server with the "Start" button.







Then we install WinSCP, we add our FTP server there under the name “android” (you can do another, but do not forget to change its name in the script below).



Now the most interesting: the synchronization script. Immediately give a link to the scripting documentation for WinSCP for those who want to redo it for themselves.



Further, my script will be given as an example, this is what it does:

1. Download to the photos folder all photos (files from the images folder of the phone) that are not yet on the computer

2. Uploads files from the files \ new computer folder to the docs / new folder of the phone (I usually have apk-files of applications, text files, etc.)

3. Uploads music files from the to_music folder to the music folder of your phone.

4. Creates (if not yet) in the files folder on your computer a new folder with today's date and moves already uploaded files from files \ new there

5. Removes the music downloaded to the phone from the computer folder to_music



Create a file android_sync.bat, which we will run to start synchronization.

# ,

# ,

# ( )

"C:\Program Files\WinSCP\winscp.com" /script="C:\Program Files\WinSCP\android_sync.txt"



#

IF NOT EXIST "D:\mobile\files\%Date%\" MKDIR "D:\mobile\files\%Date%\"



#

#

MOVE D:\mobile\files\new\*.* D:\mobile\files\%Date%



#

#

DEL D:\mobile\to_music\*.*



EXIT





Create a file android_sync.txt, where the script for WinSCP will be stored.

# « »,

#

# ..

option batch on

option confirm off



# FTP-

open android



# . local ,

#

# , ..

# « ,

# »

synchronize local d:\mobile\photos /images



#

# files\new

# docs/new . remote ,

#

#

synchronize remote d:\mobile\files\new /docs/new



#

synchronize remote d:\mobile\to_music /music



# ,

close

exit




How to use?



Now you can bring the shortcut on android_sync.bat to your desktop. Thus, the entire synchronization is reduced to a few clicks: start the FTP server, call android_sync.bat on the shortcut on the desktop, turn off the FTP server. If you do not have a WI-FI router, then with the start-stop Wireless Tether becomes a couple more clicks more. You can generally keep the number of gestures to a minimum if you keep the FTP server on all the time and place synchronization in the task scheduler.



Obviously, the FTP server method can be used not only under Windows, but the WinSCP client I have chosen is not cross-platform, and I am not familiar with any other OS closely enough. If someone in the comments describes a similar process for other operating systems, I will add it to the topic.



In addition, if you know some other ways to organize synchronization with a smartphone on Android or you have suggestions on how to improve this method - please write in the comments.

Source: https://habr.com/ru/post/94337/



All Articles