Peer to Peer chat Application

I’m creating this social app on Android where the users can connect each other without a server in the middle. The requierements are:
-The users can chat when they’re connected on same WiFi.
-The users can share files (music, documents, pictures, etc) when they’re connected on same WiFi.
I saw the example you have about a chat app on iOS but it requires a sync gateway running and I can’t use a sync gateway, the communication has to be possible without extra software.
Can Couchbase Lite fulfill my requirements?
Thank you very much.

Yes, you can use the CBL Listener component to run a tiny server in the app that can accept incoming replication connections. This can be used to implement P2P sync. There’s a fair amount of stuff you have to provide, though, especially peer discovery and authentication.

Thank you very much for your fast answer.
But how can I do that? you don’t have examples like that. Which parts of the documentation should I read?

The listener is currently available in CBL 1.x . You can see the PhotoDrop example here