I started using Adapters and I am able to run my application in the Android emulator, but it fails in my Android tablet device.
I tried to change in application-descriptor.xml localhost to 172.16.19.135:8080 but it still failed with this error message:
"Request timeout for [http://172.16.19.135:8080/apps/services/api/PrototypesDojo/android/query]"
In my Worklight project I have in the HTML a button with an onClick
call. I call a SQL Adapter.
This is my SQL adapter:
connection.xml
<displayName>connexion</displayName>
<description>connexion</description>
<connectivity>
<connectionPolicy xsi:type="sql:SQLConnectionPolicy">
<!-- Example for using a JNDI data source, replace with actual data source
name -->
<!-- <dataSourceJNDIName>java:/data-source-jndi-name</dataSourceJNDIName> -->
<!-- Example for using MySQL connector, do not forget to put the MySQL
connector library in the project's lib folder -->
<dataSourceDefinition>
<driverClass>com.mysql.jdbc.Driver</driverClass>
<url>jdbc:mysql://worklight:3306/test</url>
<user>root</user>
<password>myRootPassword</password>
</dataSourceDefinition>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="5" />
</connectivity>
<!-- Replace this with appropriate procedures -->
<procedure name="authentification" />
<procedure name="creerCompte" />
connection-impl.js
var requeteStatement = WL.Server
.createSQLStatement("select login,password from compte where login = ? and password = ?");
function authentification(login, password) {
return WL.Server.invokeSQLStatement({
preparedStatement : requeteStatement,
parameters : [ login, password ]
});
}
Error:
[http://172.16.19.135:8080/apps/services/api/PrototypesDojo/android/query] Host is not responsive. Try to manually access the URL through the android emulator browser to verify connectivity.