From what I gather, SyncAdapters are like cron jobs + some sort of data transfer protocol
Yes that is my understanding. But you still need to translate said data into something that can be used. You need to do this with any API, For example how would android know what to do with a json response? At the very least you need to dump it into a database for later use.
It is what Nextcloud is currently using to sync and update files between the device and the Nextcloud instance.
Yes the Nextcloud app uses Webdav in order to sync files, the same (extended http) protocol DAVx5 uses to get your contacts
The API call that DAVx5 and other apps use to interact with the address book is ContactsContract. That is what allows contacts to be created, read, updated, and deleted by third-party apps.
Ok, but you don’t communicate with a remote API the same way you communicate with a device side API. There are a few considerations like data sanitation, security concerns and general efficiency that prevent doing that.
My suggestion is to eliminate the need to use CardDAV protocol on Android since it is non-native.
The Webdav protocol is just and extended HTTP request, nothing non-native about that. WebDAV - Wikipedia Even if you used a Rest API you would still need to tell Android what to do with it. So why not use a good web standard.
create a “bridge” between what is received by the server-side SyncAdapter listener and Nextcloud.
Saberdav (aka Nextcloud Webdav library) is the “SyncAdapter listener” as you call it. There is no such thing as a server-side “SyncAdapter listener”, SyncAdapters are only an Android thing. Google has it’s own SyncAdapter talking to their proprietary contact back end then they translate that data into Android contacts. That said they may still be using Cardav themselves, I haven’t checked if that’s still available for a few years.
This keeps everything native to the respective platforms, would likely integrate much more seamlessly, and wouldn’t break any existing functionality.
This is actually the whole point of using a Web standard like Webdav. All data translation is done device side natively where things can change often, the Webdav standard is well defined and been around a long time so is a stable target. The DAVx5 project has years of work built in dealing with all the changes Android has had, along with the device specific fixes, hence why the Nexcloud dev’s wouldn’t want to re-do all the work already done. Even if you didn’t use Webdav you would still need to process the data on Android’s end anyway, you would just be re-doing all the existing work for little to no benefit.
As always this is based on my best understanding, I’m only a novice coder