1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question [Solved] Android 28 and non-ssl (non-https) communication

Discussion in 'Android Questions' started by asales, Jul 4, 2019.

  1. asales

    asales Well-Known Member Licensed User

    I use B4A 9.30 and OkHttpUtils2 in most of my apps to download images and post/get to a PHP server hosted in a non-https site.

    I just change the target SDK to 28 in manifest and compile the app.
    Until now all the functions thats uses internet still working.

    When I need to use this lines in my apps?:
    Code:
    CreateResourceFromFile(Macro, Core.NetworkClearText)
     
  2. DonManfred

    DonManfred Expert Licensed User

  3. asales

    asales Well-Known Member Licensed User

    I found the line above in this post, but I don't have enough information to answer my questions:
    - whats is a "non-ssl (non-https) communication" in B4A?
    - I use OkHttpUtils2 in most of my apps. I need to use this lines in the manifest?
    Thanks in advance.
     
  4. DonManfred

    DonManfred Expert Licensed User

    communication with a webservice over http. Not https
    with targetsdk 28 yes if you do use http instead of https.

    Scure your webservice and add a SSL Certificate. Use HTTPS and you dont need this in manifest.
     
    asales likes this.
  5. asales

    asales Well-Known Member Licensed User

    Thanks.
    I tested the app in a device with Android 9 and if I don't put the line, I get this error:
    Code:
    ResponseError. Reason: java.net.UnknownServiceException: CLEARTEXT communication to www.myserverphp.com not permitted by network security policy, Response:
    So, problem solved. I need this line.
     
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