0
votes

I try to deploy a worklight application into my android device (HTC Desire), without any hope I get the following error:- Request timeout for [ANDROID IP :8080/console/apps/services Default options: on failure timed out for

http://ANDROIDIP:8080/console/apps/services...

Make sure the host address is available to the app (especially relevant for android and iphone apps] I find my android IP address via whatip.com and I configure my application descriptor xml file with it. it works with android emulator when I use the following

 <worklightServerRootURL>http://10.0.2.2:8080</worklightServerRootURL>

but not with the mobile device any advice?

2

2 Answers

1
votes
  1. worklightServerRootURL should point to the public IP address of the host machine, not to the device IP.
  2. The device and Worklight Server must be in the same network (public Internet, wifi...).
1
votes

10.0.2.2 is a special address that only works on the android emulator. On the emulator, it is routed to the host where the emulator is running. On an actual device, this address won't be routed anywhere.

As Idan said, the Worklight server must be reachable from the Android device. This usually means that either the Worklight server has an address that is reachable from the internet, or that the android device has a wifi connection to the LAN where the worklight server is running.

Assuming that you are trying to test using the test server in worklight studio, first determine your computer's IP address. If you are behind a NAT router, whatip.com returns the IP of the router, not of your computer. Use ifconfig (ipconfig on windows) at a command line to determine your computer's IP address. Your computer may have several IP addresses. It is important that you choose the ones that corresponds to the LAN where you will be connecting your Android device. If you are unsure which one this is, you may need to look at your router's configuration. Next, verify that your computer's firewall has port 8080 open. Then connect your android device via wifi to the same LAN as your computer.

To verify that your device can reach the worklight server, try opening the worklight console in the phone's browser. (http://[IP of computer]:8080/console) Once that works, you should be able to use the same IP in the worklightServerRootURL to build the app so that it will work on that device.