Android device fails httpTransportSE and emulator fails

Asked

Viewed 150 times

-2

I have a server with webservices running locally.

When I run the android application in the emulator, this can connect to the webservice. When I run the same app on a real device, it doesn’t connect.

Some help?

1 answer

1


Good guys.

After two days to find out why in the emulator gave and the real device could not, I reached the solution of the problem.

PROBLEM: I made an Android application that used services and those 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 the services.

ERROR MADE: The error was in httpTransportSE, in the call(SOAP_ACTION, URL) function and was an "error (No route to host)".

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

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

HOW TO MAKE A PC FROM ROUTER:

  1. Open cmd as administrator.
  2. Diggitar: netsh wlan set hostednetwork ssid=Keyname=Password mode=allow (TO CREATE NETWORK).
  3. netsh wlan start hostednetwork (TO START NETWORK)

After these three steps the created network will already appear.

NOTE:

  • If an error appears at point 3, try using programs that create networks. (e.g., Connectify Hotspot).
  • If you have a router where you normally connect to get internet access, you do not need to set up a router on a PC.
  • To see the pre-configured 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. Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.