tags:

views:

30

answers:

3

Hi, How can I integrate into the Android SDK tools to do for example:

1) See a list of installed devices 2) Start a new device to run 3) See a list of devices started 4) Install my application (uninstall before install).

I got this from the command line but want to use it from an application.

A: 

There is no documented API to "integrate into the Android SDK tools" other than by executing the command line programs. In fact, I suspect that some of it does not have an API. The simplest thing to do, under the circumstances, is to execute the commands from your application.

CommonsWare
A: 

This is partly a shameless plug but you can check out the incomplete (still in development) project called Mad Bee (Managed Android Debug Bridge). It is a port, plus some modifications and extensions to the library used by DDMS to communicate with an ADB server. this will not replace the ADB server, but it communicates with it over TCP just like the adb client does. Feel free to contribute to the project too :)

It can get attached devices, list files, execute commands on the device, plus a ton more. The incomplete part at the moment is the "device monitor" that monitors if the device state has changed and initializing the actual android debug bridge.

Ryan Conrad
A: 

You'll need to have your app use the command line for all this, which shouldn't be much of a problem (executing a shell command and capturing the output is trivial in C#, which is what I suppose you're doing).

adb devices to get your devices, adb install -r to (re-)install the app. Not sure what you mean with "starting a device", but you can run an app with adb as well using am.

EboMike