Sunday, November 27, 2011

Obtaining Android Source Code on Microsoft Windows Platform

I was able to obtain the Android source code.

Here's a screenshot in Eclipse of what prompted me to go searching for the Android source code.







(really ugly when you try control-clicking on an Android API class only to get this)

Obtaining the source was MUCH more of a challenge than I expected, and took me several hours yesterday evening (plus an overnight download). Somehow I just imagined that the source would be available by Android API version as a ZIP or JAR file. Nope ...

In order to get it installed on Windows (which is officially not supported per the Android Open Source Project documentation), here's what I had to do:




  1. Install Cygwin. I installed Cygwin 1.7.9-1, the latest, obtained from cygwin.com.
  2. The setup.exe is a Web Installer. I specified C:\cygwin as my Root Directory, installed for All Users. When running setup.exe, administrator privileges are required.
  3. In the Cygwin Setup - Select Packages dialog, I found packages for curl, git, and python. These 3 will be necessary for obtaining the Android Source. This installation was a bit tricky, so I want to document this well here:

Cygwin - curl installation


Cygwin - git installation



Cygwin - Python installation


  1. From here, complete installation of Cygwin.
  2. Once Cygwin has been installed, create a local directory to hold the Android Source. In my case, I used C:\android\android-source.
  3. Open a Cygwin terminal session and type:
    cd /cygdrive/c/android/android-source
    (of course, using whatever path for your local directory).
  4. Now, type:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/repo
    This will pull down the repo Python script used by the Android SDK Team and place it in your local directory for Android Source.
  5. Next, type:

    repo init -u https://android.googlesource.com/platform/manifest

    This will create a .repo file and initialize the directory to hold the Android Source.
  6. Finally, type:
    repo sync

    This will do the actual downloading of the Android Source. It takes a long time, and pulled down 8.72 GB into my local working directory.



Saturday, November 26, 2011

Setting up Android Development Environment

I am going to be doing my Android Development on a Windows 7 environment. This has already proven to present a unique set of challenges, especially regarding obtaining Android source for the android.jar.

Thus far, here are the steps I have taken for setting up my dev environment:

  1. Download Java SDK 6. I always install this to C:\java\jdk1.6.0_29
  2. Download Eclipse Indigo (Eclipse 3.7.1), 32 bit. I download the "Eclipse IDE for Java EE Developers" version and unzip this (no installer) to C:\eclipse.
  3. Download Tortoise SVN 1.7.1. Figured I will need this for source/version control. I *should* switch to git at some point. However, I use Subversion at work, and did not feel like struggling with learning a new distributed version control system at this point in time (already plenty of new stuff to learn).
  4. Installed Android SDK R15 (Windows Installer). I installed this to C:\android\android-sdk and ran the Android SDK Manager.


  5. I installed everything for Android 4.0 (Ice Cream Sandwich), Android 3.2 (Honeycomb), and Android 2.3.3 (Gingerbread). This took quite some time.
  6. Install Eclipse plugin for Subclipse 1.8 (compiled against SVN 1.7)

  7. Install Eclipse plugin for ADT (Android Development Tools)



From here, I began to create a "Hello World" Application. However, as I did so, I realized that the android source was not available.

Obtaining the Android source for android.jar was quite an adventure that I'll write about in my next post.


Hello, Android

Over the Thanksgiving break, I upgraded my JDK to Java SDK 6 update 29 (I've been living in JDK 5-land for quite some time), pulled down Eclipse Indigo, and installed the Android SDK and the ADT Plugin for Eclipse.

At this point in time, I don't actually own any Android devices, yet I'm interested in getting into Android development.

I actually own 4 iOS devices (2 iPhone 4s, 2 iPad 2s). I was interested in iOS development and perused articles and books on Objective C, Cocoa, and even higher-level frameworks such as cocos2d and Corona SDK.

However, as much as I love my iOS devices, I just found it really difficult to get into iOS Development.

I've been doing Java Development for the past 12+ years. Although I think I'm fairly good at learning new languages and environments (I am comfortably able to hop between the Java and Microsoft .NET realms), I just found that there was a steep learning curve for Objective C and Cocoa.

When I first began getting into .NET development about 7 years ago, I found that C# was an easy transition for a Java developer. The .NET BCL provides many of the same classes for I/O, XML, Strings, and i18n as is provided by the core Java API. Thus, as a Java programmer in a new land, it didn't feel too horrendously foreign.

iOS development, on the other hand, felt like a completely different world.

There are definitely points in the article where my thoughts and philosophies regarding technology trends diverge from that of the author.

However, I found myself definitely relating to his points regarding the barriers to entry for iOS development, both in terms of knowledge and equipment, as well as the lack of transferability of skills developed in the iOS arena back to the world of writing enterprise business applications (he referenced the TIOBE Software Index, which in 11/2011 shows Objective-C has a Community Index Rating of 5.983% as compared to Java at 17.874%).

So, based on the fact that Android development fits with my Java / Eclipse background extremely well, I'm embarking on learning as much as I can during Thanksgiving break, and during subsequent evenings and weekends.

Tuesday, October 18, 2011

FedEx Envelope

Wow. I took a half-day vacation today. While at home, I heard a ding-dong. It was the FedEx delivery person.

Today I received my OCM - Java Enterprise Architect certificate/success kit from Oracle. Made me feel special. :-)

Wednesday, October 12, 2011

Oracle Certified Master, Java Enterprise Architect

After 2 months of extremely hard work (studying every evening, working on a design project during nights and weekends), and another 2 months of waiting, I received good news on October 6th: I achieved Oracle Certified Master, Java Enterprise Architect 5 status.

Timeline:



  • 2011-JUN-01 - Began studying early June

  • 2011-JUL-21 - Passed Part 1 Multiple Choice Exam

  • 2011-AUG-02 - Submitted Part 2 Project

  • 2011-AUG-03 - Took Part 3 Essay

  • 2011-OCT-06 - Received Congratulations Email


Part 1: Multiple Choice Exam

I used the following study material:



  • Design Patterns: Elements of Reusable Object-Oriented Software. The Gang of 4 Design Pattern book. Like any software engineer, I have a copy of this book sitting on my desk at work and reference it on occasion. However, in preparation for this exam, I read this from cover-to-cover twice.

  • Core J2EE Patterns, Deepak Alur, Dan Malks, John Crupi. I read over this book cover-to-cover, and went back several times to reference particular patterns.

  • Core J2EE Patterns Online. This site is based on the Core J2EE Patterns book. I used it in-tandem with the book.

  • Sun Certified Enterprise Architect for Java EE Study Guide, Second Edition, Mark Cade, Humphrey Sheil. This was the only exam-focused guide I used. I used it as my outline, to understand which areas the exam would cover, and where I needed to focus my time. I didn't have a hardcopy of this book, but was extremely fortunate that my employer purchased me a Safari Books Online subscription. I love Safari Books Online, have found it to be a wonderful technical resource, since I can read all the technical books I need without having to purchase hardcopy books.

  • Java EE 5 Tutorial.
Part II: Project

I LOVED doing the project. This is where I felt like I learned new skills and grew, and formalized my UML.

I have done UML diagrams for years. However, after a while, one tends to get a little bit sloppy. Blending interaction and time transition into a static class diagram, for example. It's so easy to do when one has an understanding of UML, but isn't held to a rigid standard.

The project really forced me to "clean up" and "formalize" my system design documents. At work, if I bleed a little bit of state transition into a class diagram, everyone still understands and gets the gist. However, I am sure that sort of thing would have been penalized on the Java Enterprise Architect Project (as well it should).

It took me over 40 hours. I went at it aggressively, started working on it immediately after getting home from work. At one point, I probably put in an 80 hour week (40 for work, 40 for my Java Enterprise Architect Project).

I learned how to use StarUML, and used it for the Class and Sequence Diagrams.

For the Component and Deployment Diagrams, I used Visio Stencils and Template for UML 2.2.

I learned of the Visio Stencils for UML 2.2 from Jeanne Boyarsky's posting, which was referenced on Coderanch.

Part III: Essays



This part was a proctored sit down and defend/explain aspects of the Project. I enjoy writing, so it was fun. The only thing I felt badly about is that I type extremely fast and tend to like getting my thoughts into words as quickly as possible (trying to get a stream of consciousness into a coherent essay while I have just the right words in my mind), and the keyboards at the testing center were "clicky" keyboards.


By "clicky", I mean, they make a click-klack, click-klack as I typed. Felt badly for other test-takers.

Overall, the Java Enterprise Architect Certification was by far the best learning experience I've ever had in certification series. I've never taken a certification series that involves a challenging hands-on design project prior to this.

I also thought it was really neat that they did not require any particular UML tool, or any particular approach. I had the freedom to design a system using EJBs or Web-container only, SOAP, REST, VMs, cloud, or physical machines.

I just had to clearly define and document a well-designed system that meets the business needs based on JAD session results, BRD, and Use Cases, much like the challenge faced by actual Enterprise Architects in designing solutions for businss problems.

Thursday, December 30, 2010

Cloud Computing

I've been reading a lot about Cloud Computing, especially regarding hosting. I am working on a personal development project that I will need to host at some point.

It seems that a lot of offerings that are branded as Cloud Hosting Solutions are really virtualization with automatic scaling of resources, as opposed to a pure cloud concept.

In my humble opinion (as someone who has just started learning about this subject), a pure cloud concept would be horizontal scaling of an application across multiple web servers and clustered database instances that automatically adapts to increased demands for resources (bandwidth, database and file I/O, etc.).

Some examples I've seen would be Rackspace's Cloud Sites and Google App Engine.

I played with Google App Engine during its infancy (when Python was the only supported language, and I found myself trying to learn Python / Django / BigTable as quickly as possible).

Most Cloud Hosting Solutions I've seen are really VPS or VM offerings, branded as Cloud Solutions. Many of these run in VMware or Xen.

Although I am a big fan of virtualization, I feel it's really a different category of hosting than a pure cloud solution for several reasons:

  1. You are still going to have to build out the server. The fact that it is virtual instead of a physical dedicated server does provide some advantages, with regards to pushing out clones for QA testing or increasing CPU / memory / HDD.
  2. Your VM will still reside in a single physical location that is subject to a single point-of-failure.
All in all, both virtualization and cloud computing are fascinating topics that I hope to learn more about.

Tuesday, December 28, 2010

Fedora Core 14 as VM

Well, I'm running Windows 7 Ultimate as my native OS.

However, I'm going to be doing some personal coding in PHP using the LAMP stack, and in order to get that "L", I need a Linux installation. I thought of several approaches:

  • Repartition my HDD and run a dual-boot Windows 7 / Fedora Core 14. There are several downsides to this approach. One is the fact that I never know how much space to allocate to each. The other is the fact that rebooting to get into the other OS is a pain. I've done dual boot (actually done tri-boot for Windows 98 / Windows NT / Red Hat back in the day) and the reality is I would end up spending ALL of my time in one OS.

  • Reformat my HDD to run Linux natively and do my Windows work in a VM.

  • Leave my HDD running Windows natively and do all my Linux work in a VM.

The last option (running Windows natively, Linux work in VM) seemed like the path of least resistance, and also the best fit for how I work on personal development projects. I do a lot of stuff in Microsoft .NET (as previous blog posts probably show), and I hate running an IDE in a VM. I am planning on doing my PHP development in Eclipse 3.6 (Helios) with PHP IDE PDT plugged in. I can just run Eclipse in Windows 7 natively. However, I couldn't run Visual Studio .NET in Linux natively.

One of my favorite things about VMware and this approach is how easy it is to roll back. If I were to repartition my HDD and something went wrong, I'm in a bad spot, which entails a complete reinstall of OS and Applications.

With VMware, if something goes horribly, horribly wrong with my VM, I can always just delete the files and start over.

I've never had it come to that, there's always snapshots to revert back to for VMware.

Additional notes:

  1. I tried to install using my "User" account without admin privileges in Windows 7. I've started trying to emulate the Unix security model in Windows of running as a limited privileges user and only login / su / sudo root when needing to do something like install software. This caused a problem, since VMware player need to install VMware Tools for Linux. Oops.

  2. VMware's Easy Install failed for my FC 14 install. Anaconda / kickstart got an error. Not sure why, but rather than try to run it down (I've never been a big fan of things that try to turn an already simple installation into a managed easy install), I just created a blank VM and installed FC 14 on my own. This worked just fine.