My windows 10 version is 1809

enter image description here

The option in the settings is outdated

enter image description here

I connect the smartphone

enter image description here

I open the site in the browser

enter image description here

Display network of my smartphone

enter image description here

I determine the IP address (ipconfig)

enter image description here

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ru.site.a1"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest> 

activity_main.xml

 <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <WebView android:id="@+id/webView1" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> </android.support.constraint.ConstraintLayout> 

MainActivity.kt

 package ru.site.a1 import android.support.v7.app.AppCompatActivity import android.os.Bundle import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { private var url: String = "" override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) url = "http://192.168.42.250:8000/" webView1.loadUrl(url) } } 

enter image description here

Here is such a mistake. When was the version of windows10 1803 everything was fine. Tell me, if anyone encountered such a problem. Thank.

  • In the browser on your smartphone, try to open. If it does not open, then the problem is purely network: the port is closed, there is no route, etc. - Eugene Krivenja 8:38 pm

1 answer 1

If your site opens at localhost, it’s far from the fact that it opens at 192.168.42.250 even from the computer itself. Check the firewall, and some other antiviruses can give ports to listen. If you are sure that the page is accessible from other devices, move on

Open your page in your phone’s browser. If it opens - we will think further. But I am almost sure that it will not open. When creating an interface to “NAT” computer traffic, the phone can easily not create rules that allow them to communicate directly through this interface. That is, the problem may have come not with updating Windows, but with updating the phone

Make a local network on a router with Wi-Fi, it will definitely give such an opportunity. If there is no router, you can try to get a wifi whistle for the computer and distribute the wifi from the phone to it. Also not a 100% option, but much more likely.