Remote Android SDK downloader

You may be an android developer or hope to become so. To develop with android you need Android SDK right.. so you need to download it. But do you know every latest version of Android SDK takes about 2GB space in HDD. If you start to download in your home broadband system, it would be just wasting your data. So, find a cafe or wifi hotspot to download.

Okie, how to download the android SDK remotely?? 

! caution, I dont comment my code, my code is hard to understand

for this question my friend came with a solution in Python 3.3, since its not native to Windows, it take more space in his pen drive. So he requested me today to port that app to C# and I started developing.

It was just a XML parser application but I am still afraid of XML tags like <sdk:version>. Actually this is a namespace XML tag but the existing solution available in stackoverflow.com were not working for me. So I replaced “sdk:” with “f” and coded.

This was my code to parsin

private void doParse(string webUr)
        {
            WebClient htClient = new WebClient();
            string result = htClient.DownloadString(webUr);
            result = result.Replace("sdk:", "f");
            XDocument xdoc = XDocument.Parse(result, LoadOptions.None);

            var query = from x in xdoc.Descendants("farchive")
                        select new
                        {
                            partOfSpeech = (string)x.Element("furl")
                        };
            foreach (var ee in query)
            {
                if (ee.partOfSpeech.Substring(0, 4) != "http")
                {
                    richTextBox1.Text = richTextBox1.Text + "https://dl-ssl.google.com/android/repository/" + ee.partOfSpeech.ToString() + "n";
                    progressBar1.Value += 1;
                }
                else
                {
                    richTextBox1.Text = richTextBox1.Text + ee.partOfSpeech.ToString() + "n";
                    progressBar1.Value += 1;
                }
            }
        }

using this method I parsed 3 web uris to generate the download links of the current Android version.

I have packaged my app and its available for downloads here. This app needs DotNet 4.0. After installing this app, open it, click on “GetLinks” button to get the links in the text box. Copy them and paste them in your portable downloader and start download them

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s