LibGDX supports Desktop (Windows, Linux and Mac), Android and web applications. Can i code the network part of an online game without taking care of what kind a of application i'm running? i.e coding the network engine interdependently of the application type.
If you just want to target desktop and android devices, you can use the same networking library, as long as the library supports android.
Kryonet is a networking library, that works both on desktop and android, and it is very easy to use (just look at the example from the page).