4
votes

I'm trying to get a clear picture of what's involved practically when doing Android/ADK development. There are some scattered Android/ADK related questions on SO with usually very few relevant answers.

I have some questions related to development and an idea of what the answer is - it would be great if anyone can confirm my thoughs or provide additional information.

  1. Can Android/ADK development be done within an AVD?

    Answer: No, because your PC cannot function as a USB slave. The ADK will be the USB host in accessory mode, so (without extreme levels of hacking) the ADK cannot be connected to the development PC running the AVD

  2. Will the DDMS / debugger work on a device that's hooked to an ADK?

    Answer: No, since the device can only be connected to either the development PC or the ADK, not both. You can connect the ADK using the micro usb port to the PC and do Arduino-level serial debugging, but that's quite different from debugging the java code the Android device is running

  3. What workflow is used when developping for Android / ADK?

    Answer:

    1. Write your Arduino code in Sketch, upload it to your ADK development board.
    2. Connect your physical android device yo your development PC
    3. Write your code in Eclipse, compile it to an APK, install it to a physical device.
    4. Unplug your phyisical Android device, hook it up to the ADK board, test if things work. Either use the app itself for debugging (e.g. write log statements to the screen) or use the Arduino serial connection for logging from the Arduino software.
    5. If there are issues, fix them (either in Arduino or Java), go back to 1. or 2.

Am I correct in the above answers? It sounds very complex/slow to develop/test code this way. Even a simulated ADK with the AVD would be a big improvement.

1
I don't do Arduino code but play.google.com/store/apps/details?id=com.aide.ui may be something helpful?James
interesting link (don't think it supports debugging). Might actually work on my Transformer Prime (since it has a keyboard), but I'm not sure if it supports ADK Accessory mode (the prime that is)Ivo van der Wijk
I don't know if you have figured out a better way to do it yet but I was playing around with adie which allows you to compile and run code from android phone and it has drop box integration so you can edit code anywhere sync it and then compile it. Makes the flow a little easier.stephenmm

1 Answers

2
votes

You are exactly right by answering your own questions 1. and 3.

However when it comes to question 2., there is a way to debug your ADK project as usual even while the device is attached to the accessory. You can use the adb connect functionality to connect to your device via WiFi for debugging and DDMS purposes.

Have a look here for details on how to do that:

ADB, Wifi and Eclipse: how I can configure?