Archived

This forum has been archived. Please start a new discussion on GitHub.

Getting Ice.SocketException with Android hello app

I'm trying to get started with the Android test apps and I'm getting an exception and both the emulator and the hardware device. Using the emulator I changed the timeout to 1.0 and delay to 1.0 and selected Oneway calls. I changed the default IP to the IP of my PC (I think the app started with 10.0.0.2 which didn't seem correct because my PC's IP address starts with 195.x.x.x. Hello server is running on the PC. When I click the "Hello World" button after a delay it comes back with "Ice.ConnectTimeoutException"

When I switch to the an actual hardware device I get Ice.SocketException using the same setup.

I am using android API level 8.


AndriodManifest.xml does have the following setting:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

What could I be missing?

Thanks,
John Basrai

Comments

  • mes
    mes California
    Hi John,

    As explained here, the Android emulator sets up its own virtual network in which the special address 10.0.2.2 refers to the loopback adapter on your development machine. Consequently, if the server is running on your PC, then you'll want to use 10.0.2.2 as the target host address in your client.

    Regards,
    Mark
  • Same result.

    Thanks for your reply.

    I tried using 10.0.2.2 and I got the same results for both the emulator and the hardware device. IceGrid is running on the PC as well and that should be the first place the client connects. Server is connecting to the locator using a localhost address rather than PC's ipaddress so locator must be listening on 127.0.0.1

    Thanks,
    -john
  • I see the problem. The client is using a direct proxy and the server is using an indirect proxy. I need to change one or the other. I think I will change the server for now since this is just a test.
  • Hello app working!

    Emulator works now but hardware device still gets "SocketException". Device I'm using must not have network connectivity to the host and I have no wireless network available to try. I'm going to leave it at that for now.

    Thanks for your the Mark.