Topic
  • 2 replies
  • Latest Post - ‏2013-01-03T19:17:16Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic worklight server url problem

‏2013-01-03T18:44:53Z |
i am having problem with worklightServerRootURL thing is in emulator app is working successfully,but when i tried to install in mobile its showing network error (my app doesn't require internet connection)

my observations
1)app is taking my ip as host address ..
so when ever my worklight server is on in my pc, app is running in device
when my server is off app showing network error

2)i tried replacing "http://${local.IPAddress}:8080" in android discriminator with
i)localhost:8080
ii)127.0.0.1
iii)127.0.0.1:8080
iv)10.0.2.2
v)10.0.2.2:8080

and exported apk file with above worklightServerRootURL address

no one works for me..

i need perfect suggestion about

android apk file installing in device with settings of server for app running in device

i tried installing in android 2.3.4 version

so please help me in solving my problem
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: worklight server url problem

    ‏2013-01-03T19:10:18Z  
    If your application does not require an internet connection, then check your initOptions.js file and make sure the "connectOnStartup" is set to false:

    var wlInitOptions = {

    // # Should application automatically attempt to connect to Worklight Server on application start up
    // # The default value is true, we are overriding it to false here.
    connectOnStartup : false,
    However, if the above is set to true and you have http://${local.IPAddress}:8080 for the worklightServerRootURL value, then you can try connecting your device to the internet and it should work as well.
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: worklight server url problem

    ‏2013-01-03T19:17:16Z  
    Why are you trying to change the development server's URL? Just leave it set to "http://${local.IPAddress}:8080" , which is the default for the Jetty instance your WL Dev server is running on. Although, "http://localhost:8080" should work...

    For WL to function properly, you should have the appropriate server side app running.

    Again, don't mess with the worklightServerRootURL until you are going to deploy it to a remote server for testing or deployment. Leave it as "http://${local.IPAddress}:8080". If you can run it in the emulator, you should be able to plug in an Android device and install it by "Run As > Build And Deploy" in the WL app, and "Run As > Android Application" in the Android app that WL spits out in your Eclipse environment.

    If you have a question about deploying the app to a remote server, then please open a new thread. But, I would advice you to leave that setting be when you are testing in Eclipse.

    Ralph Pina