Lesson 1: Setting up a new Android project

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

 Set up a new Android project in Eclipse
  1. Copy the Android libraries to your Android CustDB sample directory.

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

    setup.bat

    The UltraLiteJNI12.jar and libultralitej12.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 %SQLANYSAMP12%\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 UltraLiteJNI12.jar, and then click Edit.

    5. From your working directory, open \CustDB\libs\UltraLiteJNI12.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 %SQLANY12%\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.