I'm currently trying to make a communication between my Raspberry Pi 2 and my smartphone (Samsung Galaxy S7). I'd like to do it using a USB cable, does anyone know if it's possible and how to do it?
I think in effect you're asking if the Pi can support USB host mode (a.k.a. On-The-Go or OTG). From reading assorted posts, I gather that you can't do this with any of the Pis that have built-in Ethernet (which is provided with a chip that sits on the internal USB and somehow this prevents host mode from being used).
The Pi A and the Pi Zero (but probably not Zero W) apparently can be used this way, but apparently not any of the others.
I'd provide links but I didn't find any that were clear enough to include here. Googling for "raspberry pi host mode" will find most of the same stuff I read. Another question has relevant answers though.
If you want to copy files to and from your smartphone's storage, you need to install an MTP program (either a commandline tool or a graphical file browser) on your Raspberry Pi.
One graphical program that's easy to use is
nautilus. It's a file browser with a lot of dependencies, so it might take awhile to install, but it's intuitive.
If you're running Raspbian Linux, these instructions for Debian Linux should work. Basically:
mtp-detect(it should see your phone)
fusermount -u /path/to/emptyfolder
jmtpfs -l(it should see your phone)
Now you should be able to see all of your phone's files in