Glorithm
Glorithm

Reputation: 361

Compile error with Arduino ADK + Android + Processing Example

I am trying to run the Arduino ADK + Android examples (analogRead, digitalWrite, etc.) But I am getting the following compile error:

-compile:
     [javac] Compiling 3 source files to     C:\Users\???\AppData\Local\Temp\android7678598093798196219sketch\bin\classes
     [javac]  C:\Users\???\AppData\Local\Temp\android7678598093798196219sketch\src\processing\android\test\adk_analogRead.java:28: cannot access com.android.future.usb.UsbAccessory
     [javac] class file for com.android.future.usb.UsbAccessory not found
     [javac]     arduino.connect( arduino.list()[0] );
     [javac]            ^
     [javac] 1 error

I did some research and found this 9 months old post - http://forum.processing.org/topic/how-can-you-specify-the-target-api-level - where it talks about recompile Processing from source. However, I'm using version 2.0a5 and the team has already changed the source to use API level 10. (I also verified the generated code when I look inside the manifest xml file in temp folder.) Any idea how to fix this?

Just in case, I've successfully compiled and ran regular Processing app and deployed to Android (Nexus One.)

Upvotes: 1

Views: 1832

Answers (3)

Neil Mendoza
Neil Mendoza

Reputation: 151

Here's what I did to get the ArduinoAdkUsb examples to compile:

  1. In Processing, switch to Android Mode
  2. In Processing, go to Android -> SDK Manager
  3. In SDK Manager, install Android 2.3.3 (API 10) -> Google APIs if not installed
  4. Copy sdk/add-ons/addon-google_apis-google-10/libs/usb.jar to Processing/libraries/ArduinoAdkUsb/library/
  5. Restart Processing

Upvotes: 0

paulbovbel
paulbovbel

Reputation: 90

To use ADK, you can use API Level 10, but it needs to have the Google APIs attached (same thing you need to use Maps in your application).

If you're having trouble enabling the Google APIs, try switching to API level 12, where you no longer need the addon. However you'll now be using the android.hardware.usb library instead of com.android.future.usb.

Upvotes: 1

MKJParekh
MKJParekh

Reputation: 34301

I think you need to use Google Android Api 3.1+

Upvotes: 1

Related Questions