I cannot get the Kotlin SDK demo weather app running

The Readme at GitHub - openziti/ziti-android-app says,

name = ziti-weather-service
hostname = wttr.ziti
port = 80

endpoint host = wttr.in
endpoint port = 80
endpoint protocol = tcp

So I went ahead on nfconsole.io and tried to make a simple service:

and an advanced one:

Both are co-existing on my default free tier network and that identity's .jwt was downloaded to my device and I enrolled it in the Kotlin app (saw the message confirming that in the UI).

I also have a policy

So I thought I was good to go, try to run the app in Android Studio, and as mentioned enroll the .jwt but pushing the message button does not get me the weather nor change the UI in any other way.

The output in the Android Studio console is lke

10/30 20:47:43: Launching 'app' on ZTE A202ZT.
Install successfully finished in 99 ms.
$ adb shell am start -n "io.netfoundry.ziti.sample/io.netfoundry.ziti.sample.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 12133 on device 'zte-a202zt-320226898815'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/dry.ziti.sampl: Late-enabling -Xcheck:jni
I/dry.ziti.sampl: Using CollectorTypeCC GC.
W/re-initialized>: type=1400 audit(0.0:1589): avc: granted { execute } for path="/data/data/io.netfoundry.ziti.sample/code_cache/startup_agents/09f4021c-agent.so" dev="dm-12" ino=117553 scontext=u:r:untrusted_app:s0:c144,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c144,c257,c512,c768 tclass=file app=io.netfoundry.ziti.sample
W/dry.ziti.sampl: DexFile /data/data/io.netfoundry.ziti.sample/code_cache/.studio/instruments-a7e44b7b.jar is in boot class path but is not in a known location
W/dry.ziti.sampl: Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
W/dry.ziti.sampl: Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.
E/dry.ziti.sampl: Attempt to load writable dex file: /data/data/io.netfoundry.ziti.sample/code_cache/.overlay/base.apk/classes3.dex
W/ziparchive: Unable to open '/data/data/io.netfoundry.ziti.sample/code_cache/.overlay/base.apk/classes3.dm': No such file or directory
W/ziparchive: Unable to open '/data/app/~~l7ev4ZRXQIllU5rQ0VcuAg==/io.netfoundry.ziti.sample-TQynEKQTuB_IVLhExmGgmw==/base.dm': No such file or directory
W/ziparchive: Unable to open '/data/app/~~l7ev4ZRXQIllU5rQ0VcuAg==/io.netfoundry.ziti.sample-TQynEKQTuB_IVLhExmGgmw==/base.dm': No such file or directory
I/LoadedApk: No resource references to update in package androidzte
I/ZteBinderProxy: initLastBindTime: USE_CACHE = true
W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
W/System.err: SLF4J: Defaulting to no-operation (NOP) logger implementation
W/System.err: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
W/dry.ziti.sampl: Accessing hidden method Ljava/net/Socket;->getImpl()Ljava/net/SocketImpl; (max-target-o, reflection, denied)
W/dry.ziti.sampl: Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed)
W/dry.ziti.sampl: Accessing hidden method Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V (unsupported, reflection, allowed)
W/dry.ziti.sampl: Accessing hidden method Ljava/net/Socket;->getImpl()Ljava/net/SocketImpl; (max-target-o, reflection, denied)
W/dry.ziti.sampl: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
W/dry.ziti.sampl: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
I/SurfaceFactory: [static] sSurfaceFactory = com.mediatek.view.impl.SurfaceFactoryImpl@c8ddfaf
I/MsyncFactory: [static] sMsyncFactory = com.mediatek.view.impl.MsyncFactoryImpl@2e9bfbc
I/PowerHalWrapper: PowerHalWrapper.getInstance 
I/BufferQueueConsumer: [](id:2f6500000000,api:0,p:-1,c:12133) connect: controlledByApp=false
I/BLASTBufferQueue: [ViewRootImpl[MainActivity]#0] constructor()
E/OpenGLRenderer: EglManager::makeCurrent mED = 0xb400007c62a28dd0, surface = 0x0, mEC = 0xb400007c02a452e0, error = EGL_SUCCESS
I/BufferQueueProducer: [ViewRootImpl[MainActivity]#0(BLAST Consumer)0](id:2f6500000000,api:1,p:12133,c:12133) connect: api=1 producerControlledByApp=true
E/OpenGLRenderer: fbcNotifyFrameComplete error: undefined symbol: fbcNotifyFrameComplete
E/OpenGLRenderer: fbcNotifyNoRender error: undefined symbol: fbcNotifyNoRender
E/ActivityThread: Failed to find provider info for com.zte.intellitext.IntelliTextProvider
D/ConfigUtil: config null
D/IntelliTextControl: load info error
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/CompatibilityChangeReporter: Compat change id reported: 171228096; UID 10400; state: ENABLED
W/dry.ziti.sampl: Accessing hidden field Landroid/widget/AbsListView;->mIsChildViewEnabled:Z (unsupported, reflection, allowed)
D/WindowClient: Add to mViews: android.widget.PopupWindow$PopupDecorView{5fec410 V.E...... R.....I. 0,0-0,0}, this = android.view.WindowManagerGlobal@68626c1mViews.size()=2
D/WindowClient: Add to mViews packageName:io.netfoundry.ziti.sample
D/ViewRootImpl[PopupWindow:9734b0d]: hardware acceleration = true, sRendererEnabled = true, forceHwAccelerated = false
I/BufferQueueConsumer: [](id:2f6500000001,api:0,p:-1,c:12133) connect: controlledByApp=false
I/BLASTBufferQueue: [ViewRootImpl[PopupWindow:9734b0d]#1] constructor()
I/BufferQueueProducer: [ViewRootImpl[PopupWindow:9734b0d]#1(BLAST Consumer)1](id:2f6500000001,api:1,p:12133,c:12133) connect: api=1 producerControlledByApp=true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
E/OpenGLRenderer: EglManager::makeCurrent mED = 0xb400007c62a28dd0, surface = 0x0, mEC = 0xb400007c02a452e0, error = EGL_SUCCESS
I/BufferQueueProducer: [ViewRootImpl[PopupWindow:9734b0d]#1(BLAST Consumer)1](id:2f6500000001,api:1,p:12133,c:12133) disconnect: api 1
D/OpenGLRenderer: endAllActiveAnimators on 0xb400007ca2a82220 (MenuPopupWindow$MenuDropDownListView) with handle 0xb400007bb2ab4af0
D/View: [Warning] assignParent to null: this = android.widget.PopupWindow$PopupDecorView{5fec410 V.E...... R.....ID 0,0-588,144}
I/BLASTBufferQueue: [ViewRootImpl[PopupWindow:9734b0d]#1] destructor()
I/BufferQueueConsumer: [ViewRootImpl[PopupWindow:9734b0d]#1(BLAST Consumer)1](id:2f6500000001,api:0,p:-1,c:12133) disconnect
I/BLASTBufferQueue: releaseBufferCallbackThunk bufferId:52110838202372 framenumber:20 blastBufferQueue is dead
D/VelocityTracker: getVelocity: id:0, vx=0.098259, vy=-0.048859
D/VelocityTracker: getVelocity: id:1, vx=128.214127, vy=445.496368
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: solveUnweightedLeastSquaresDeg2: count:8, time:0.037795 s, dy:22.990479, b:636.394531, direction of k:0.001250
D/VelocityTracker: getVelocity: id:1, vx=239.215179, vy=636.394531
W/System.err: java.net.SocketTimeoutException
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl$Connector$DefaultImpls.doConnect(AsyncSocketImpl.kt:59)
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl$DefaultConnector.doConnect(AsyncSocketImpl.kt:65)
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl$DefaultConnector.connect(AsyncSocketImpl.kt:67)
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl.connect(AsyncSocketImpl.kt:119)
W/System.err:     at java.net.Socket.connect(Socket.java:646)
W/System.err:     at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:120)
W/System.err:     at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
W/System.err:     at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
W/System.err:     at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
W/System.err:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
W/System.err:     at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/System.err:     at java.lang.Thread.run(Thread.java:1012)
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: solveUnweightedLeastSquaresDeg2: count:6, time:0.030247 s, dy:-4.997803, b:-235.912857, direction of k:-0.000056
D/VelocityTracker: getVelocity: id:0, vx=152.566696, vy=-235.912857
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
D/VelocityTracker: addMovement: actionMasked:1, mChangeDirection:0, set it true
W/System.err: java.net.SocketTimeoutException
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl$Connector$DefaultImpls.doConnect(AsyncSocketImpl.kt:59)
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl$DefaultConnector.doConnect(AsyncSocketImpl.kt:65)
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl$DefaultConnector.connect(AsyncSocketImpl.kt:67)
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl.connect(AsyncSocketImpl.kt:119)
W/System.err:     at java.net.Socket.connect(Socket.java:646)
W/System.err:     at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:120)
W/System.err:     at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
W/System.err:     at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
W/System.err:     at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
W/System.err:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
W/System.err:     at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/System.err:     at java.lang.Thread.run(Thread.java:1012)
W/System.err: java.net.SocketTimeoutException
W/System.err:     at org.openziti.net.nio.AsyncSocketImpl$Connector$DefaultImpls.doConnect(AsyncSocketImpl.kt:59)

it looks to me that your service is mis-configured. The hosting side of the service need to be assigned to an edge router or tunneler endpoint -- what application is using kotlin-demo-id identity?

I am reaching out to seek some clarity and guidance regarding a concept demonstrated in the recent demo, which I am finding challenging to fully grasp. In my previous experience as a Flutter developer, our typical setup involved a Flutter front-end paired with a Python back-end hosted on AWS. In that scenario, I viewed the Python back-end on AWS as the host. When deploying on a Ziti network, I understood that I needed to register the host endpoint/identity with the service, following a policy, as demonstrated with the Flask example in the Python SDK repository samples folder. This setup allowed me to successfully access the dark site via my Android device's browser, where I considered the Android device as the client.

In the recent demo, the identity kotlin-demo-id was enrolled by the Kotlin app displayed on screen. I proceeded to download the identity from nfconsole.io onto my laptop, and thereafter transferred it to a folder labeled Documents/Ziti on my Android device. The application seemed to allow navigation through my folders to select the identity, leading to a successful "Enrollment Success" message post-selection.

However, I am encountering a challenge with understanding what might be misconfigured in my service as outlined above. I am kindly requesting step-by-step instructions on how to rectify or add the necessary configurations on nfconsole.io to ensure the seamless operation of the service as demonstrated.

I am keen on understanding the mechanics of this setup, and any detailed guidance will be greatly appreciated. I am available for any further discussions or clarifications that might be required to resolve this issue.

Thank you for your prompt attention to this matter. I look forward to your guidance.

That is the service and I have the Net Foundry Edge router attached under Edge Router attributes in green in the left column.

But the right column I am not sure if I filled in correctly based on what's shown in the Kotlin repo readme: ```name = ziti-weather-service
hostname = wttr.ziti
port = 80

endpoint host = wttr.in
endpoint port = 80
endpoint protocol = tcp```

I don't understand why there is wttr.ziti and wttr.in and how I need to fill in the console boxes with all that info.

My Edge Router Policy:

I also updated the Service by adding wttr.in as an intercept IP. which then lets me use that in the Forward Address box at the bottom of the right column:

But it's still not working.

I saw these lines in MainActivity.kt:

fun loadData() {
        val request = Request.Builder()
            .url("http://wttr.ziti/Rochester?format=3")
            .header("host", "wttr.in")
            .build()

so I tried changing the service at nfconsole.io to "No, not an SDK application" which is strange because this example is supposed to show off the Kotlin SDK.

but it didn't work anyways.

Edit: no, actually this worked. So please update your documentation at GitHub - openziti/ziti-android-app and Android | OpenZiti.

Actually I just looked at MainActivity.kt again and it looks like it is using an SDK:

                try {
                    val addr = Ziti.getDnsResolver().resolve(hostname) ?: InetAddress.getByName(hostname)
                    return listOf(addr)
                } catch (e: Exception) {
                    Log.w("sample", "Exception: " + e.message)
                }
                return Collections.emptyList()
            }
        }

        val d = DnsSystem()

        client = client.newBuilder()
            .socketFactory(Ziti.getSocketFactory())
            .sslSocketFactory(Ziti.getSSLSocketFactory(), getTrustManager())
            .dns(d)
            .callTimeout(5, TimeUnit.MINUTES)

I see Ziti in there more than once.
But on the console I have to say "No" to SDK.
So there's a mismatch?
Or is there a way to flick that SDK switch to "Yes" in the console and fill in the boxes differently and still get this sample to work?