Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » UltraLite - Java Programming » Tutorial: Building an Android application

 

Lesson 1: Setting up a new Android project

In this lesson, you create a new Android project through the Eclipse Integrated Development Environment.

Prerequisites

This lesson assumes that you have installed the required software. See Tutorial: Building an Android application.

Context and remarks

This tutorial assumes that you are familiar with Java and Eclipse.

 Task
  1. Copy the Android libraries to your Android CustDB sample directory.

    Open a command prompt, change to the %SQLANYSAMP16%\UltraLiteJ\Android\CustDB\ directory, and then run the following command:

    setup.bat

    The UltraLiteJNI16.jar and libultralitej16.so files are copied into the Android\CustDB\libs and Android\CustDB\libs\armeabi directories.

  2. Run Eclipse.

    The default application path is C:\Eclipse\eclipse.exe.

  3. In the Workspace field, specify a working directory that is not your CustDB sample directory, and then click OK.

  4. Import the CustDB project into Eclipse.

    1. Click File » Import.

    2. Expand the General directory, and then click Existing Projects into Workspace. Click Next.

    3. In the Select Root Directory field, type %SQLANYSAMP16%\UltraLiteJ\Android\CustDB. Select Copy Projects Into Workspace, and then click Finish.

  5. Make sure that the appropriate Android SDK path is specified in Eclipse.

    Note

    You must install an Android SDK before specifying the path. For more information about tutorial prerequisites, see Tutorial: Building an Android application.

    1. Click Window » Preferences.

    2. In the left pane, click Android.

    3. In the SDK Location field, type the location of the Android SDK and then click Apply.

      A list of available build targets appears.

    4. Click OK.

  6. Make sure that the UltraLiteJ library path is specified in Eclipse.

    1. Click File » Properties.

    2. In the left pane, click Java Build Path » User libraries.

    3. Click the Libraries tab.

    4. Click UltraLiteJNI16.jar, and then click Edit.

    5. From your working directory, open \CustDB\libs\UltraLiteJNI16.jar.

    6. Click OK.

  7. Add the path to your UltraLiteJNI Javadoc documentation to the project.

    1. In the left pane, click Javadoc Location.

    2. Click Browse, and then open %SQLANY16%\UltraLite\UltraLiteJ\Android\html.

    3. Click OK.

    4. Click OK to close the window.

  8. Build the project.

    Click Project » Clean, and then click OK.

    The project should build without errors occurring, but you may notice warnings listed under the Problems tab.

Results

The UltraLiteJ API is functional in the new Android application.