感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Set up your environment

Prerequisites

The Mobile Associates API is provided as a JAR library which you include in your Android project. This can be done with any IDE. The following guide will walk you through the steps using Eclipse. Before getting started you will need to have Eclipse and the Android SDK installed. You can find detailed information on Eclipse and Android at the following links:

Adding Drawable Folder to Resources

A Drawable folder is included in the Mobile Associates folder. You need to copy the content into application's res/drawable folder.

Adding Mobile Associates JAR to your Eclipse project

  1. In Eclipse, create or navigate to your Android project root folder, right click, and select the Properties view.
  2. Click Java Build Path on the left
  3. Click on the Libraries tab at the top
  4. Click Add External Jars on the right
  5. Navigate to the where you extracted the APPs-SDK.zip file, navigate to Apps-SDK/Android/MobileAssociates/lib folder and select the Mobile Associates jar file
  6. Click Open
  7. Click OK

Adding Mobile Associates API Reference to your Eclipse Environment

Many developers find it useful to add Mobile Associates API Reference to their project as well. This allows you to view the reference documentation within Eclipse, similar to Java and the Android SDK.

  1. In Eclipse, navigate to your Android project root folder, right click, and select the Properties view.
  2. Click Java Build Path on the left
  3. Click on the Libraries tab at the top
  4. Expand the Mobile Associates Jar
  5. Select Javadoc location
  6. Click Edit
  7. Click Browse
  8. Navigate to the directory you extracted the APPs-SDK.zip file, then to the Apps-SDK/Android/MobileAssociates/documentation/API-Reference folder
  9. Click OK
  10. Click OK

 The Mobile Associates API reference is now integrated into Eclipse and you should see windows like the below screenshot directly from Eclipse.