Android device fails on httpTransportSE and the emulator does not [close]

-2

I have a server with webservices running locally.

When I run the android application on the emulator, it can connect to the webservice. When I run the same application on an actual device, it does not connect.

Any help?

    
asked by anonymous 27.02.2018 / 22:47

1 answer

2

Good malt.

After two days to find out why the emulator did not work and the real device did not work, I came to the solution.

PROBLEM: I ran an Android application that used services and these services ran on a local server. When testing the app in the emulator the application ran and the services were called, but when testing on a device, it could no longer call services.

ERROR LAUNCHED: The error you gave was in httpTransportSE, in the call function (SOAP_ACTION, URL) and was a "(No route to host)" error.

REASON FOR THE PROBLEM: After an investigation into why this is happening, it concludes that it was due to the location where the services were run (place of the server - IP) and not a code problem. The services were running locally, so the Android application knew the location (IP) of the server (services), it was necessary that both were running on the same network.

SOLUTION: Make a router PC (create a network) and connect both the server (services) to that created network as the android device.

HOW TO MAKE A ROUTER PC:

  • Open the cmd as an administrator.
  • Digit: netsh wlan set hostednetwork ssid = Nomedarede key = Password mode = allow.
  • netsh wlan start hostednetwork
  • After these three steps, the created network will appear.

    NOTE:

    • If you get an error in point 3, try using programs that create networks. (ex: Connectify Hotspot).
    • If you have a router where you normally connect to the Internet, you do not need to configure a router on a PC.
    • To see the preconfigured networks (open cmd as administrator): netsh wlan show profiles
    • If you want to delete the created network (open cmd as administrator): netsh wlan delete profile name="profile_name"

    It was the problem and solution that I found and worked. Thanks!

        
    02.03.2018 / 11:34