Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

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?

asked 05 Aug '11, 00:13

Resare%20Lew's gravatar image

Resare Lew
accept rate: 0%

edited 08 Aug '11, 03:46

Assuming you have code a bit like this:

SyncParms sp = _conn.createSyncParms("ml_username", "script_version");
StreamHTTPParms httpParms = sp.getStreamParms();

Then for an emulator synchronizing to a MobiLink server on your desktop, you need to use the special host value "", 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("") and the setURLSuffix would have an argument like this:

permanent link

answered 05 Aug '11, 11:49

Tom%20Slee's gravatar image

Tom Slee
accept rate: 29%

Comment Text Removed
Comment Text Removed
Comment Text Removed

Thanks for your answer.

I thought that we should set the host,port,suffix,username and password in my program to connect to the MobiLink server.Just like JDBC.But in CustDB's code,I did not find that.So I felt very confused about it...

Now I know that we should use the Sybase Relay Server.Then our application can relate to the Sybase Relay Server.But how does the MobiLink server relate to the Sybase Relay Server?

As my Android application will synchronize data with Oracle 10g database,I used ODBC to create the MobiLink server.And the Oracle database was installed on another machine.Both of the machines are in a internal network currently...

(08 Aug '11, 03:14) Resare Lew
Replies hidden

Do you mean that the host should be set as ""(localhost) and with no URLSuffix if I run emulator/local machine?But how does my application relate to the specified MobiLink server without URLSuffix?

(08 Aug '11, 03:14) Resare Lew
Replies hidden
Comment Text Removed

The Relay Server is provided to help connections through firewalls without opening up additional ports to the outside world.

(08 Aug '11, 10:49) Tom Slee

"Do you mean that the host should be set as ""(localhost) and with no URLSuffix if I run emulator/local machine?" Yes. Your application just needs to find the host and port that MobiLink is listening on. The URLSuffix is there in case you need to supply additional parameters. If you go through the Relay Server you need to provide a URL Suffix because you need to tell the Relay Server which MobiLink server you are interested in talking to.

(08 Aug '11, 10:50) Tom Slee
Comment Text Removed

My colleagues who develop WinCE applications can use SQL Anywhere to synchronize data directly.However,android platform does not have API supports about JDBC.So we must do that with UltraLiteJ and the Relay Server,which look like a little complicated.What a pity!

(08 Aug '11, 21:10) Resare Lew

If I use Sybase Hosted Service,there's no need to deploy the Relay Server Components to IIS/Apache,is there?

(08 Aug '11, 23:52) Resare Lew

Does your colleague use JDBC on a WinCE device to connect straight to a SQL Anywhere server? That would be a bit different to the sync setup.

I think the other main difference is network access and name resolution, which is not really under our control. If your Android device is on a LAN (through a VPN for example) then it could talk straight to MobiLink without a Relay Server. The JDBC URL is just a machine name, and so the CE device must be on a network that provides name resolution.

(09 Aug '11, 09:03) Tom Slee

That is correct. The Hosted Relay service is not intended for production use, though.

(09 Aug '11, 09:03) Tom Slee

Thanks for your help once again!

(09 Aug '11, 21:15) Resare Lew
Comment Text Removed
Comment Text Removed
Comment Text Removed
Comment Text Removed
Comment Text Removed
Comment Text Removed
Comment Text Removed

This is my program fragment in Synchrnize method:


SyncParms syncParms=conn.createSyncParms(SyncParms.HTTP_STREAM,"test","ksfd 12.0");

StreamHTTPParms streamParms=syncParms.getStreamParms();




SyncResult result=syncParms.getSyncResult();


return result;


My MobiLink server has been deployed and startuped as the Sybase DocCommentXchange says.But the MobiLink server's console did not print more new information.In my program,ULjException has been catched,but I saw no exception information.Instead,I saw my program running without responding... What's the matter?I guess that there must be something wrong with my MobiLink server.It does not relate to the client(UltraLiteJ on Android).But I just deployed it as the Sybase DocCommentXchange says.And the documentation does not tell enough about Android and UltraLiteJ...

(11 Aug '11, 06:27) Resare Lew

I thought that the main thread must have blocked(no responding),so I wrote the synchronization fragment in a new Thread Class and implemented Runnable.This time,the main thread did not block.However,the Data synchronization failed again...

(11 Aug '11, 06:27) Resare Lew
More comments hidden
showing 2 of 11 show all flat view
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 05 Aug '11, 00:13

question was seen: 3,758 times

last updated: 27 Oct '23, 14:10