1

I'm trying to ping an IP address like google.com in android studio using Kotlin

how would I do this

  • 1
    'View/Tools Window/Terminal' (or ALT+F12). Then type `ping .....` – Luuk Apr 10 '21 at 10:52
  • Did you try one of these posts: [How to Ping External IP from Java Android](https://stackoverflow.com/questions/3905358/how-to-ping-external-ip-from-java-android) or [How to ping the server in Android?](https://stackoverflow.com/questions/17493010/how-to-ping-the-server-in-android) – flaxel Apr 10 '21 at 10:52
  • I did some research and see 2 possible ways. 1) use `InetAddress#ping`, `InetAddress` is from Java, however some people say this doesn't work (see [this SO post](https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address)). 2) execute the shell command `ping` from within Kotlin, see [this SO post](https://stackoverflow.com/questions/35421699/how-to-invoke-external-command-from-within-kotlin-code) – jakobeha Apr 12 '21 at 03:13

0 Answers0