Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

SyncParms sp = _conn.createSyncParms(SyncParms.HTTPS_STREAM, "ml_username", "script_version");
StreamHTTPSParms streamParms = (StreamHTTPSParms) syncParms.getStreamParms();
streamParms.setHost( host );
streamParms.setPort( port );

I have started my MobiLink server correctly:

<Main> https.2500: RSA_TLS: This secure stream is being encrypted using security technology from Certicom Corp.
<Main> This software is using security technology from Certicom Corp.
<Main> MobiLink server started

If I try to connect to the ML server through my android app I get Error code 224. (I have no problems connecting through HTTP)

asked 22 Aug '11, 11:35

sebastiansier's gravatar image

accept rate: 0%

edited 22 Aug '11, 14:24

Graeme%20Perrow's gravatar image

Graeme Perrow

Error code 224 is "Failed to load library" (see here).

It looks like you need to include the library in the same folder as the UltraLite library (the libsarmeabi subdirectory of your project). You can find in the UltraLite\UltraLiteJ\Android\ARM subdirectory of your SQL Anywhere application.

If you have any issues with certificates for HTTPS, you may find something in a recent blog post on the subject: see here.

permanent link

answered 22 Aug '11, 11:49

Tom%20Slee's gravatar image

Tom Slee
accept rate: 29%

edited 22 Aug '11, 11:50

In my project, I have the library in my libs/armeabi folder. When I deploy my project to the emulator I found the and under data/data/<my-project-package>/lib/

I've also created my HTTPS certificates and started my MobiLink server correctly, but still can't connect through my app.

Thanks for your help.

(22 Aug '11, 12:03) sebastiansier

Are you still getting Error Code 224? As I say, that's "Failed to load library". If it's not a missing library, then I am not sure what would be causing it.

(22 Aug '11, 15:47) Tom Slee

Yes, i am still getting error code 224. The library is not missing, it is just not loading.

(22 Aug '11, 16:54) sebastiansier

The next thing to verify is that the 2nd parameter to DatabaseManager.createConfigurationFileAndroid() is a valid Context object. Eg.

ConfigFileAndroid config = DatabaseManager.createConfigurationFileAndroid(
permanent link

answered 22 Aug '11, 13:47

Andy%20Quick's gravatar image

Andy Quick
accept rate: 45%

When executing DatabaseManager.createConfigurationFileAndroid the second parameter has the value: (I can see this in debug mode). Also, when executing the same code but trying to connect to an HTTP server i have no problems, so I asume it is a valid context object. Any other suggestions?

(22 Aug '11, 13:58) sebastiansier

Everything seems right. You say you are using the Android emulator? Which platform are you targetting? Can you give a small test program that reproduces the error? Thanks.

(22 Aug '11, 17:10) Andy Quick

I modified our custdb sample to use HTTPS data sync (pasting in some of the code you provided), but still could not reproduce the problem.

It occurs to me that it could be the MobiLink server that could not find a library. Where do you see the error message with code 224? In the ML server log? A ULjException in the client application? Also, please give us the exact text of the error message.

The below is the ULjException that I get in the custdb application if I manually remove from the emulator:

08-24 10:50:08.448: ERROR/CustDB(273): com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-1305]: MobiLink communication error -- code: 224, parameter:, system code: 0

(24 Aug '11, 11:08) Andy Quick

The error is the same as you posted:

com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-1305]: MobiLink communication error -- code: 224, parameter:, system code: 0

but I have data/data/<package>/lib/ in the emulator.

(24 Aug '11, 13:15) sebastiansier

I am almost out of ideas. You could check that the that is in the emulator is byte-for-byte the same as the one in the SQL Anywhere install.

If that is the case, the only other thing is that something in your application is different from the applications we use to test with. Could you package up a complete Eclipse project that shows the problem? (eg. using the ML server command line for our custdb sample, with the sample rasroot.crt in the install) If we can reproduce the problem, then we can fix it. Thanks.

(24 Aug '11, 14:06) Andy Quick

PS You can email me the sample Eclipse project at firstname.lastname [at]

Andy Quick Sybase, an SAP company

(24 Aug '11, 14:08) Andy Quick

Sebastian - We cannot reproduce this issue here: our samples using HTTPS do work. You could test your environment by trying the CustDB sample included with SQL Anywhere and changing StreamHTTPParms to StreamHTTPSParms, to see if that project works for you. Otherwise, emailing the project as suggested or opening a tech support case look like the ways forward.

(25 Aug '11, 14:42) Tom Slee
More comments hidden
showing 5 of 7 show all flat view

Here is my code:

Connection _conn;
ConfigPersistent _config;

public void onCreate(Bundle savedInstanceState) {

    InputStream is = getResources().openRawResource(R.raw.cert);
    FileOutputStream os = openFileOutput("cert.pem", MODE_PRIVATE);
    byte[] buff = new byte[4096];
    int n;
    for(;;) {
        n =;
    if (n < 0) break;
    os.write(buff, 0, n);

        _config = DatabaseManager.createConfigurationFileAndroid("DATABASE_NAME", getApplicationContext());
        _conn = DatabaseManager.connect(_config);
        _conn = DatabaseManager.connect(_config);

        SyncParms syncParms = _conn.createSyncParms(SyncParms.HTTPS_STREAM,_user,_version );

        StreamHTTPSParms streamParms = (StreamHTTPSParms) syncParms.getStreamParms();
    streamParms.setHost( _host );
    streamParms.setPort( _port );
        _conn.synchronize( syncParms );
    } catch (Exception e) {

I am using an Android 2.2 emulator.
Thanks for your help.

permanent link

answered 23 Aug '11, 09:23

sebastiansier's gravatar image

accept rate: 0%

edited 24 Aug '11, 13:02


One thing I notice in this code fragment is that the ConfigFileAndroid object that is returned by DatabaseManager.createConfigurationFileAndroid() is not stored in a variable. You must actually pass this object as an argument to DatabaseManager.createDatabase() or connect(). Using a ConfigPersistent object that was created without going through createConfigurationFileAndroid() would cause a problem like this.

(24 Aug '11, 11:56) Andy Quick

I edited the code, i was actually doing what you say ... buy still get the error.

(24 Aug '11, 13:09) sebastiansier
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: 22 Aug '11, 11:35

question was seen: 4,236 times

last updated: 25 Aug '11, 14:42