Mindan
Mindan

Reputation: 1019

IBM Worklight - Is it possible to change ip address of the android device?

I am trying to deploy a Worklight application to an Android device, without success. The same application has been deployed to iPad, where there is a function that allows the user to set up the IP address. I know it is not a perfect solution but right now it will serve the purpose.

I want to know if the same function possible in android devices.

Upvotes: 0

Views: 1466

Answers (1)

Idan Adar
Idan Adar

Reputation: 44516

Nada,
Please mention what is the Worklight Studio version you are using. From the comments it sounds like Worklight 5.x.


Unlike iOS, Android also has an internal server within.

If you use the following in application-descriptor.xml: <worklightServerRootURL>http://${local.IPAddress}:8085</worklightServerRootURL>

The application will look for the Worklight Server inside the device. That, will obviously not work.

When using an Android device, be sure that the value you give worklightServerRootURL is the IP address of the machine hosting Worklight Server (meaning, the machine where you have Eclipse installed with the Worklight Studio plug-in).

  1. Open a CMD window
  2. type ipconfig
  3. Copy the public IP address of the machine
  4. Use it as the value for WorklightServerRootURL
  5. Re-build All and Deploy
  6. Run application on device

By doing the above, the application (whether it is installed on iPad, Android emulator or Android device) will always try to reach the actual machine that hosts the server.


Notes:

  • The feature you're talking about, called "Worklight Settings", is not meant for end-users. It should be turned off when moving to production
  • This feature does not change the IP address of the device; it changes the server URL for the application to connect to
  • This feature also exists in Android, and is accessible by tapping on the physical menu button in the device and then on the "Worklight Settings" button

    I do suggest, though, that you follow my steps instead, so that your project will be properly configured.

  • If you really do mean that you want to change the IP address of the device for whatever reason, that's not related to Worklight.

Upvotes: 1

Related Questions