Question

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.

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top