WPS editor in windows ten...
- Laptops & Computers
- 0 Replies
Sometimes go off the icons for about a few minutes and it shrinks back to normal though, is this a bug?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
class MainActivity : AppCompatActivity() {
private var active : Boolean = false
private var data : String = ""
//private var button = Button(this)
private lateinit var textView : TextView
private lateinit var button : Button
override fun onCreate(savedInstanceState: Bundle?){
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
button = findViewById(R.id.button)
textView = findViewById(R.id.textView)
val address = "192.168.0.100"
val port = 5000
button.setOnClickListener { it: View!
if (button.text == "connect")
{
active = true
CoroutineScope(IO).launch{ this: CoroutineScope
client(address, port)
}
}
else
{
active = false
button.text = "connect"
}
}//button
}//onCreate
final suspend fun client(address: String, port: Int){
val connection = Socket(address, port)
val writer : OutputStream = connection.getOutputStream()
writer.write(1)
val reader = Scanner(connection.getInputStream())
while(active)
{
var input = ""
input = reader.nextLine()
if (data.length < 300)
data += "\n$input"
else
data = input
textView.text = data
}//while
reader.close()
writer.close()
connection.close()
}
}//class