0

In my worklight hybrid app, I want to get two info:

  1. app version (the version the end-user sees in the various App Stores or in the device)
  2. IP address

How can I do it?

Hugh Shao
  • 35
  • 7

1 Answers1

1

IP address: The Worklight Hybrid application does not have any IP address. The client (the app...) connects to the Worklight Server. The IP address you set the client to connect to is set in application-descriptor.xml as the value of worklightServerRootURL.

If you mean that you're actually looking for the device IP address, you can get this using WL.Device.getNetworkInfo.

App version: Like with the IP address, the "version" of the Worklight application is set as well in application-descriptor.xml as an attribute of the environment element.

<android version="1.0">
...
...
...
</android>

You can retrieve it by using WL.Client.getAppProperty("APP_VERSION").

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • Idan, thank you. I do want to get the device IP address. Your suggestion is working fine. – Hugh Shao May 08 '13 at 07:09
  • For the app versions in your Example or the version the end-user sees in the various App Stores or in the device, aren't they about the same? – Hugh Shao May 08 '13 at 07:14