How can i use sockets?


#1

In my project i need to get data from a server how can i import socket into kotlin script?
and other question why there is no a website that explain about the language,if there is one i really would like to get a link.

thanks:)


#2

https://kotlinlang.org/docs/reference/


#3

It really depends on what you want to achieve.
Typically with Android most users want a JSON over HTTP connection, but if you want rare sockets you can simply import the appropriate Java classes from the java.net package.
See here https://docs.oracle.com/javase/tutorial/networking/sockets/definition.html
Or here https://developer.android.com/reference/java/net/Socket

Answers like this you will more easily find on stack overflow, as this is not a “how to Java” or “how to Android” forum.


#4

Check this simple basic…socket programming