Is there a way to download android sdk from android website programmatically? Does google provide any rest api/url for that? I have developed one developer side application for which I determine if android sdk is installed or not, if not installed I should be able to download latest sdk from Android website programmatically. Is this possible?
Asked
Active
Viewed 491 times
4
-
You could analyze what the SDK Manager does. It is fetching some [XML files](http://dl-ssl.google.com/android/repository/addon.xml) to determine what packages are available. That API is probably not meant to be used by everyone but it's there. – zapl Aug 06 '13 at 13:03
-
Thanks, I will give a try. Where can i find code for sdk manager? – Aug 06 '13 at 13:05
-
Not sure if it is open source or otherwise available. Try a network sniffer like [Wireshark](http://www.wireshark.org/) to check what files it fetches & maybe use a [decompiler](http://java.decompiler.free.fr/?q=jdgui) to look into it's code (`./android-sdk/tools/lib/sdkmanager.jar`). – zapl Aug 06 '13 at 13:11
1 Answers
1
Decompilation as suggested in one of the comments is overkill. You just need to parse the XML content from https://dl-ssl.google.com/android/repository/repository.xml . Check the SDK:url tag and use that to fetch (wget, curl, httpclient, ...) the required zip files.

hcpl
- 17,382
- 7
- 72
- 73