I'm just learning SQL Anywhere.Recently I have a Android project which uses MobiLink to synchronize data with Oracle 10g database.The sample CustDB I've read,but I'm not very clear on URLSuffix and SQL Anywhere Relay Server.So I do not know how to connect to the specified MobiLink server in my own application.Who can give me a hand?
Assuming you have code a bit like this:
SyncParms sp = _conn.createSyncParms("ml_username", "script_version"); StreamHTTPParms httpParms = sp.getStreamParms(); httpParms.setHost(host); httpParms.setURLSuffix(urlSuffix); _conn.synchronize(sp);
Then for an emulator synchronizing to a MobiLink server on your desktop, you need to use the special host value "10.0.2.2", with no URLSuffix. The port will be 80 by default, so if you are running the ML server on a different port you will need to call httpParms.setPort(NN) as well. I'd recommend getting emulator/local machine running first, as it has the fewest moving parts.
As a second setup, if you have a device that needs to synchronize and which is not on an internal network (so it can't resolve the host name of the machine your MobiLink server is running on) then you can set up an account on our hosted relay server. Here are some old instructions on how to do that.
Then you would call setHost("relayserver.sybase.com") and the setURLSuffix would have an argument like this:
answered 05 Aug '11, 11:49