I am developing an mobile application using IBM MobileFirst Plaform.
When I test the app in the browser, Mobile simulator and android emulator the application is working fine. When I deploy the apk file in my android device and run the application is not running. when I checked the logcat I have the following error.
I/Web Console(20334): processMessage failed: Message: F09
WLAuthorizationManagerPlugin1268447688
{"wlFailureStatus":"UNRESPONSIVE_HOST","status":500,"responseText":"","statusText":"The
service is currently not available."} at
file:///android_asset/www/default/worklight/cordova.js:1063
Both my laptop and Mobile are connected to same wifi network
Your server is likely set to "localhost".
- Open the Servers view in Eclipse
- Double-click on "MobileFirst Development Server"
- Change the host value to the IP address of your machine (if you have several IP addresses, be sure you use the correct one)
- Re-start the server (should happen automatically after saving your changes in step 3)
- Re-build the application by right-clicking on the app folder > Run As > Run on MobileFirst Development Server (this ensures the set IP address will propogate to the project's wlclient.properties file)
- Delete the application from the device
- Re-install the newly generated application (from step 5)
Verify that the application is now able to connect to the MFP Server.
Did you check wlclient.properties file in native android folder??
In that file check wlserverhost and wlserver port. Before that if you deploy your app to any remote server that ip address and port number should configured for android environment.
Change that IP address and port number by un-check Build the application to work with a different Mobile first server...
Re build the application to the local mobile first server..
Para eclipse luna 4.4.0 and WORKLIGHT 6.3
function wlCommonInit() {
//set url de conexion para Android
var environment = WL.Client.getEnvironment();
if (environment == WL.Environment.ANDROID) {
WL.App.setServerUrl("https://<SERVER>: <PORT>/<contextPATH>",setServerURLSuccess, setServerURLFailure);
}
........
};
and create two methods
function setServerURLSuccess() {
// Display the newly set server URL.
//alert(getServerURL());
}
function setServerURLFailure() {
WL.SimpleDialog.show(
"Change Server URL", "Failed setting Server URL",
[{
text: "Close", handler: function() {}
}]
)
}
Saludos!!!