Correct, the Java API is only for Android -- it references android.* packages, which aren't in desktop Java.
To target desktop, you'd have to use the Cronet native C API (you could call this from a Java desktop app via JNI -- it can also be used directly from C++).
We don't provide official support for Cronet on desktop today, so you'd have to build the library from the Chromium repository, which it sounds like you've already done.
That should give you an environment to try out the API.
The API is intentionally similar to the Java / Android Cronet API, and is mostly defined in an
IDL file (using Chromium's mojo IPC language -- however, note that Cronet native is in-process) that's transformed into
C headers via a
generator script. The main entry header,
cronet_c.h, defines a few extra functions that aren't in the IDL. IDL interfaces with the [Abstract] keyword are implemented by the app.
For example, an IDL interface like UrlRequest makes methods like:
Cronet_UrlRequest_Destroy()
Cronet_UrlRequest_InitWithParams()
Cronet_UrlRequest_Read()
...
Similarly, structures generate methods like this (we don't share anything but void pointers across the library boundary -- the headers have function definitions only):
Cronet_UrlRequestParams_http_method_set()
Cronet_UrlRequestParams_request_headers_add()
Cronet_UrlRequestParams_request_headers_size()
Cronet_UrlRequestParams_request_headers_at()
Cronet_UrlRequestParams_request_headers_clear()
-Caleb