Coordinating with Firelord, who suggested this in a comment while I waited for the migration to complete, we decided I shall go ahead with the answer. So here it is:
If only the two Android devices should be involved (and no outside computer, not even your own), this problem will need two apps to be worked out:
One device needs to act as "server". On this you need to install some Server app. Any FTP/SSH/WebDAV/Samba server will do. To keep the ball low, I'd try with a simple and minimal FTP app first: FTPServer is small and lightweight (just about 100k
.apk size; all others I know of go beyond the 1.5M order).
The second device will be client and actor. On this you install FolderSync, which can deal with all the mentioned protocols. Setup a folder pair and a schedule, and you're done. Apart from the schedule, you can always trigger a sync manually or, with the paid version, even via Tasker (that's the way I use FolderSync, and it works great).
For this to work, you'll need a few conditions met:
- both devices need to be within the same (WiFi) network
- the one acting as server should either have a "fixed IP" (real fixed or always the same assigned by your DHCP server), or a host name that resolves on that WiFi network.
Now, how would that match your requirements:
- Synchronize a folder between two Android devices: Yes.
- Not using "external resources": Check.
- Direct device-to-device sync: Yo.
- On the same network: Yupp.
- Synchronize as soon as both connect to the same WiFi network: That might be a bit tricky, as neither of the two knows whether the other has joined already. But you could …
- setup FolderSync to check all e.g. 10 minutes when connected to a specified network (multiple networks can be defined)
- use the paid version and Tasker, and have Tasker check the other device's presence before firing up the sync (can be done e.g. by requesting some "dummy file" via FTP and check the response code)
Things would be easier if some other local resource (e.g. a web server in the Intranet) could be involved. If that's the case, leave a note – and I'll post a second answer for that.