alert string update fix
This commit is contained in:
parent
e01c0c1145
commit
bafe1db4a0
@ -1,6 +1,7 @@
|
|||||||
package com.example.flightgearcontrollerapp.model
|
package com.example.flightgearcontrollerapp.model
|
||||||
|
|
||||||
import java.io.PrintWriter
|
import java.io.PrintWriter
|
||||||
|
import java.net.InetSocketAddress
|
||||||
import java.net.Socket
|
import java.net.Socket
|
||||||
|
|
||||||
class TelnetClient{
|
class TelnetClient{
|
||||||
@ -9,11 +10,13 @@ class TelnetClient{
|
|||||||
private lateinit var output:PrintWriter
|
private lateinit var output:PrintWriter
|
||||||
fun connect(ipAddress: String, portAddress: Int): Boolean {
|
fun connect(ipAddress: String, portAddress: Int): Boolean {
|
||||||
return try {
|
return try {
|
||||||
client = Socket(ipAddress, portAddress)
|
client = Socket()
|
||||||
|
client.connect(InetSocketAddress(ipAddress, portAddress),5000)
|
||||||
output = PrintWriter(client.getOutputStream(), true)
|
output = PrintWriter(client.getOutputStream(), true)
|
||||||
true
|
true
|
||||||
}catch (e: Exception){
|
}catch (e: Exception){
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
|
throw RuntimeException(e)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<string name="txt_rudder">Rudder</string>
|
<string name="txt_rudder">Rudder</string>
|
||||||
<string name="disconnect">disconnect</string>
|
<string name="disconnect">disconnect</string>
|
||||||
<string name="alert_dialog_flightgear_connection">FlightGear Connection</string>
|
<string name="alert_dialog_flightgear_connection">FlightGear Connection</string>
|
||||||
<string name="alert_instruction">For connecting to FlightGear App,\nFirst open the app.\nThen, copy these lines to Setting-> Additional Setting:\n\n --telnet=socket,in,10,\'ip\',\'port\',tcp,playback_small \n\n and now just press fly!</string>
|
<string name="alert_instruction">For connecting to FlightGear App,\nFirst open the app.\nThen, copy these lines to Setting-> Additional Setting:\n\n --telnet=socket,in,10,\'ip\',\'port\',tcp\n\n and now just press fly!</string>
|
||||||
<string name="ok_btn">continue</string>
|
<string name="ok_btn">continue</string>
|
||||||
<string name="alert_title">FlightGear Connection</string>
|
<string name="alert_title">FlightGear Connection</string>
|
||||||
<string name="connection_failed">Connection failed!</string>
|
<string name="connection_failed">Connection failed!</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user