Android Question JRDC and TargetSDK 28

Discussion in 'Android Questions' started by marcick, Jul 12, 2019.

  1. marcick

    marcick Well-Known Member Licensed User

    In order to keep my app running in the future news, I'm moving to targetSDK 28.
    My app communicate with my server where runs JRDC and the first problem I see is this

    Code:
    ResponseError. Reason: java.net.UnknownServiceException: CLEARTEXT communication to (ip) not permitted by network security policy, Response:
    Accordin to what I see here, I have added to the manifest this code:

    Code:
    <uses-library
          android:name=
    "org.apache.http.legacy"
          android:required=
    "false" />)   

    AND

    SetApplicationAttribute(android:usesCleartextTraffic,
    "true")
    Now everything seems to works fine. Am I safe like this or is it better/mandatory to switch to HTTPS instead of HTTP ?

    In the second case, it is not clear to me what to do to switch to HTTPS. Do I have to do some modification in my (cloud) server ? Do I need to ask the provider for this service ? Do I have to change something in the firewall policy ? And what to do in the B4A app also ?
    Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    1. The "uses library" is not required.
    2. You are safe like this. Maybe one day Google will restrict it but it is allowed for now and they will not change it without notice.
    3. If the data being sent should be secured then it is a good idea to switch to https. It is quite simple.
    Enabling SSL: https://www.b4x.com/android/forum/threads/server-ssl-connections.40130/#content

    The only change required in the clients is to switch from http to https.
     
    marcick likes this.
  3. marcick

    marcick Well-Known Member Licensed User

    1. I have substituted all the above code in the manifest with this, is that ok ?

    Code:
    CreateResourceFromFile(Macro, Core.NetworkClearText)
    I'll have a look to SSL, thanks
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Yes.
     
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