Sample code for 30+ languages & platforms
Android™

Get Version of Chilkat

Demonstrate how to find out the version of Chilkat at runtime.

Chilkat Android™ Downloads

Android™
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //  Most Chilkat classes include a Version property.
    //  To find the version of Chilkat, such as "9.5.0.94",
    //  instantiate the object and examine the Version property.

    //  For example:
    CkSFtp sftp = new CkSFtp();
    String chilkatVersion = sftp.version();
    Log.i(TAG, chilkatVersion);

    //  Most other Chilkat classes also have the Version property
    //  For example:
    CkJsonObject json = new CkJsonObject();
    Log.i(TAG, json.version());

  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}