Reputation: 3297
How can I integrate into the Android SDK tools to do for example:
I got this from the command line but want to use it from an application.
Upvotes: 1
Views: 2046
Reputation: 6900
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.
Upvotes: 4
Reputation: 77722
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
.
Upvotes: 0
Reputation: 1006584
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.
Upvotes: 0