httpadapterworklight-adapters

HTTP Adapter not working on real Android device-Mobilefirst platform


referring to my previous post. Using Worklight(MFP) HTTP Adapters with REST/JSON Services To solve the issue i had to change the value of the host name in the mobilefirst development server from "localhost" to the ip address of my pc so that it works on the android emulator. While installing the .apk file on a real device it does not work. I think when i get the .apk, the ip address i set in the hostname(the ip of my pc) is applied in the

/android/native/assets/wlclient.properties

wlServerProtocol = http
wlServerHost = 192.168.1.2 
wlServerPort = 10080

can i have some help please. Thanks.


Solution

  • The IP address that is used by the client application is indeed controlled by the wlclient.properties file.

    You can edit this file before building the .apk.

    You can also:

    1. Right-click on the MobileFirst application folder -> Run As -> Build Settings
    2. Change the IP address
    3. Build again

    From now on, the IP address inside wlclient.properties will be the one you specified above in step 2.