Creating the Android Project

Create a new Android SUP101Sample project in Unwired WorkSpace. You add library resources and set other application properties.

Prerequisites
Task
  1. Start Unwired WorkSpace.
  2. Select File > New > Project.
  3. Select Android > Android Project and Next.
    Depending on the Android version you are using, the information you provide in the next several steps may be in one or two screens.
  4. In the New Android Project wizard, use these values and click Next.
    • Project Name – enter SUP101Sample.
    • Select Create new project in workspace if it is not already selected.
    • Select Use default location if it is not already selected with, for example, C:/Documents and Settings/user/workspace/SUP101Sample.

    Android Tutorial Create Android Project Image
  5. In the Select Build Target window, click an Android version 2.2 or later and Next.


  6. In the Application Info window, use these values and click Finish.
    • Application Name – enter SUP101Sample if it does not already appear.
    • Package Name – enter com.sybase.sup.samples.objectapi.
    • Click Create Activity and enter SUP101SampleActivity if these do not already appear.
    Tip: To correct a mispelled Package Name, right-click the package and select Refactor > Rename to change the name and update all references.
    In the left pane, you should see the Package Explorer with the SUP101Sample project listed. Also, in the src folder a default Sample Activity class was automatically generated for the project.
  7. In Package Explorer, modify the build path to point to the correct location for the ClientLib.jar, sup-client.jar, and UltraLiteJNI12.jar files for the project:
    1. Select the SUP101Sample project.
    2. Select Project> Properties > Java Build Path.
    3. Select the Libraries tab.
    4. Click Add External JARs and browse to C:\Sybase\UnwiredPlatform\MobileSDK\ObjectAPI\Android.
    5. Select all the JAR files, then click Open.
    6. Click OK.

    Android Tutorial Add Java Build Path Image
  8. Add a compiler resource to the root directory of the Android project:
    1. In Windows Explorer, browse to C:\Sybase\UnwiredPlatform\MobileSDK\ObjectAPI\Android.
    2. Copy the armeabi folder.
    3. In Package Explorer, select SUP101Sample and add a libs folder.
    4. In the libs folder, paste the armeabi folder.
  9. In Package Explorer, add user permissions to the project:
    1. Expand the SUP101Sample project.
    2. Double-click the AndroidManifest.xml file.
    3. Select the AndroidManifest.xml tab.
    4. Add permissions to the AndroidManifest.xml file as a child element of the <manifest> element. You can use the AndroidManifest.xml file from the ZIP archive to cut and paste the following text:
      <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    5. Select File > Save.