Android Question Socket not connected with Android 9

Discussion in 'Android Questions' started by jlalexie, Aug 15, 2019 at 11:44 AM.

  1. jlalexie

    jlalexie Member Licensed User

    Hello,


    I'm programming with B4A 9.0 and I'm happy with this product (easier than Android Studio).

    I use a TCP Client socket to communicate with a Wi-Fi ESP8266 access point (no internet connection): "Public CltSock As Socket".

    Everything works great for Android versions 5 to 8.

    But no Wi-Fi connection with an Android 9.0 smart phone (Huawei). "Sub Client_Connected (ConStatus As Boolean)" returns "ConStatus" false.

    In the manifest, I added: "CreateResourceFromFile (Macro, Core.NetworkClearText)" but nothing in Wi-Fi connection (as it is said in

    https://www.b4x.com/android/forum/threads/android-jar-targetsdkversion-minsdkversion.87610/page-2.

    )

    Here are the B4a and the Android Manifest file.


    Thank for help
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Tip: this is a mistake:
    Code:
    <uses-permission
      android:name=
    "android.permission.WRITE_EXTERNAL_STORAGE"
       android:maxSdkVersion=
    "28" />
    It should be 18 if you are only accessing RuntimePermission.GetSafeDirDefaultExternal.

    What is the output of Log(LastException) in Client_Connected?

    Make a test, put the device in airplane mode and enable wifi (cellular network should be disabled). Does it work? Android will prefer the network with internet connection.

    See this: https://www.b4x.com/android/forum/threads/mqtt-chat-network-error.90892/#post-574610
     
  3. jlalexie

    jlalexie Member Licensed User

    thank you,
    I do not currently have the Android 9 smart phone to control the Log(LastException) in Client_Connected.
    I will do the tests as soon as I get the SP.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice