From 95924f06511c18503a28b6ca18ed782d3eef95ff Mon Sep 17 00:00:00 2001 From: Vinicius Fortuna Date: Thu, 12 Oct 2023 15:23:29 -0400 Subject: [PATCH] Update Android example to use kotlin --- x/mobileproxy/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x/mobileproxy/README.md b/x/mobileproxy/README.md index f8be0000..a7efdf95 100644 --- a/x/mobileproxy/README.md +++ b/x/mobileproxy/README.md @@ -189,16 +189,16 @@ To add the library to your mobile project, see Go Mobile's [Building and deployi You need to call the `RunProxy` function passing the local address to use, and the transport configuration. -In Java, you have: -```java +On Android, you can have the following Kotlin code: +```kotlin // Use port zero to let the system pick an open port for you. -mobileproxy.Proxy proxy = mobileproxy.runProxy("localhost:0", "split:3"); +val proxy = mobileproxy.runProxy("localhost:0", "split:3") // Find the address the local proxy is bound to. -String proxyAddress = proxy.address(); +val proxyAddress = proxy.address() // Configure your networking library with proxyAddress. -... -// Stops the proxy. -proxy.stop(); +// ... +// Stop running the proxy. +proxy.stop() ``` ## Configure your HTTP client or networking library