Archive for the ‘CollabNet Subversion Edge’ Category

BlackBeltFactory: If you are a teacher at heart and love technology, this is your place…

While studying Java for fun and to take the Java certification from the Sun Microsystems back in 2004, I used to hang out in different tutorial websites with reviews for the exams. I was still living in Brazil, where I grew up, when I first started studying Java at the University and seeing passionate about the “Write Once, Run Anywhere” premise… When I found JavaBlackBelt in 2006, I joined it to try perfecting my Java skills and keep up-to-date with the language. Given the transformation of how Social Networking took the Internet, everything changed since then, as they changed their branding and name to BlackBeltFactory, as well as have added social interaction capabilities and a market place for developers, technologists and the ones who love to teach and learn.

My previous experience was just related to my own learning experience: practice/learn the fundamentals of the Java Programming Language. It was essentially a website where users could go and take exams in different subjects related not only with Java, but also with relating technologies such as XML, Web Services, Hibernate, etc. However, I must confess that it is hard to keep up with the exams when you have your day-to-day job, school obligations, etc. I had conquered the Java Blue Belt and I was facing a lot of changes starting with moving from New York to California for the dream of the Silicon Valley and then having the opportunity to engage on another 2 years of my dreamed MS and work with what I love: Java and Computer Science. The academic world can take all of your time with research papers to read (ACM was my browser’s start page) and exams/finals. On the other hand, the only place where I could focus on practicing Java was my research projects: (my thesis and conferences). So, I never became a JavaBlackBelt per say and I was cleaning my mailbox when the name BlackBeltFactory was showing up on older and older emails. Yes, JavaBlackBelt had evolved and “taken the Social Networking train”. There are a list of changes listed on their website here.

The very first basic change BlackBeltFactory did was to take advantage of their infrastructure and start thinking on a more “language/vendor-agnostic” approach: why not offering training in other languages? I saw C# another programming language listed on their website and I must say that the BlackBeltFactory was a cool place to hang out and take exams prepared and reviewed by peers in the community. It is definitely a place to challenge your skills set on a given track. You can only take exams when you provide contributions: review questions, add comments, etc. This approach requires the user to be active in the learning community.

In my opinion, BlackBeltFactory’s natural progression could not have been different: take advantage of the Social Networking capabilities that we are currently live to provide the user’s better learning experience. Teaching is one of my passions and I must say that BlackBeltFactory did a great job in adding features like “Become a coach”. After you have passed the exam to be a coach, it seems that you can either create a free or a paid training to someone. Similarly, users interested about learning can ask others about services of teaching a specific topic. This marketplace is healthy and very interesting to me in the sense that I don’t need to drive anywhere to teach someone something I’m passionate about. As far as I could see, BlackBeltFactory offers the process for both participants to engage on a program. Hummm… Now I don’t need to think about going for PhD and teach! 😀

Another great feature is the translation capability. Although the previous version of the website branded as JavaBlackBelt was awesome for English Speaking users, the platform could not capture users of other nationalities and without knowledge of English. As a Brazilian, I can say that it is difficult, in general, to the ones who are starting with our field of technology/science to properly “bootstrap” their career because of the restricted access to content in Portuguese. That’s why I made sure I had Portuguese as one of the first translated versions of CollabNet Subversion Edge as I’m working in the project. BlackBeltFactory just gave me yet another reason to stick around and contribute to their community as I have a passion for learning and sharing knowledge.

All in all, I think I have to squeeze more of my time to play around in the BlackBeltFactory! For the love of teaching, I have already joined 2 Brazilian groups for the translations and I will make time to review exams and try to get my Java BlackBelt 😀 I could not get even the yellow in Kung Fu when I was 15, but I think I might have potential for Java. I have liked my LinkedIn and Twitter accounts, which are nice as a linking resource.

Google CodeSearch: your best friend to Reverse Engineer Android Code to your Android app

September 30, 2010 4 comments

I’m on my 4th week developing my first Android Application: a client to the Discovery API for the CollabNet Subversion Edge Server, which I started writing to validate the implementation of the Discovery API I had written based on a previous implementation using jmDNS for the Subversion Edge server. The first version was definitely exciting because I wanted to see how the Discovery API, which uses the Bonjour Protocol (ZeroConf/mDNS from Apple), behaved on Android. Since I only have some evenings and weekends to work on it, it has become difficult to keep track of all the topics learned so I decided to do a crash course and watched the video “Beyond Helloworld” and get an insight of what is to be developing on Android. I got hooked!!! For a Java/Linux lover myself, it is very addicting to develop on it because I was once a JavaME developer and did develop a few applications at my Motorola Brazil Test Center internship. Anyway, here’s the YouTube video I did when I first finished the version 0.0.1 😀 There are still technical Strings exposed to the UI but, as you can see, I had fun producing a video using the Android Screencast and Mac iMovie.

After getting familiar with the terminology with Activity and Service Classes, etc, I started developing different features one by one. Considering each application has its own unique requirements, you definitely need to understand the API, read the Java Docs and the fundamental documentation provided by Google and others via blog posts. However, the more you start developing a customized application with icons, colors, etc, the more addicted you get 🙂

Google Android - Add to Home screen Dialog with images

So, customizing components sometimes is tricky because of the different ways to implement something. However, there are similarities on UI components and behavior you want to use in your application to maintain the standard behavior of you application. That’s when I had a requirement that add a custom Dialog to an item of a list of Subversion Edge servers that are discovered in the network, showing the options for that type of server. The Dialog needs to have the associated icon that is displayed in the list, and the options with associated icons. The section Creating Dialogs does not offer the implementation of customized dialog I wanted, not an example of an Adapter that does the trick, and I did try different ways to create a layout with icons, but I couldn’t get it right. Maybe that’s the things a novice Android developer does…

Considering another options to get the implementation of an a Dialog Adapter for my requirement, I thought there might be an example of what I wanted. That’s when I remembered that the long press event of the home screen shows a Dialog with menu options with the icons, as shown in screenshot below:

I thought to myself, “Wait, Android is Open-Source!”, and it’s not the iPHONE! 🙂 That moment I went to Google Code Search, a product still branded as to be in “Google Labs” that I use to look for open-source code (Eclipse, Subversion, etc, etc). So, I started using the menu title “Add to Home screen”  as my search key and I could only find it when I used the exact value found in the source-code sufixing the string with “</string>”, found in the strings.xml. Here’s the URL of the search.

<!-- Shortcuts -->
    <skip />
    <!-- Title of dialog box -->
    <string name="menu_item_add_item">Add to Home screen</string>

Bingo! I found the String with its associated  key “menu_item_add_item” and the only thing to do now is to find the implementation of the method that creates the menu item and reuse that on my own customized version for my long item press. So, I did another search for the key “menu_item_add_item” and another success!!! Here’s the implementation of the dialog showed in the screenshot above.

     * Displays the shortcut creation dialog and launches, if necessary, the
     * appropriate activity.
    private class CreateShortcut implements DialogInterface.OnClickListener,
            DialogInterface.OnCancelListener, DialogInterface.OnDismissListener,
            DialogInterface.OnShowListener {

        private AddAdapter mAdapter;

        Dialog createDialog() {
            mWaitingForResult = true;

            mAdapter = new AddAdapter(Launcher.this);

            final AlertDialog.Builder builder = new AlertDialog.Builder(Launcher.this);
            builder.setAdapter(mAdapter, this);


            AlertDialog dialog = builder.create();

            return dialog;

Great, note that the implementation of the dialog has its own implementation of the Adapter called “AddAdapter”, a second piece of implementation where the icons and titles might be defined. So, I looked for the Adapter class “” and I was happy to find everything needed there, and for my surprise, no layout implementation in XML. I guess sometimes hard-coded layouts are all you need anyway if you don’t reuse the same thing in a different place. I then looked for the class and I found the implementation of the menu items.

    public AddAdapter(Launcher launcher) {

        mInflater = (LayoutInflater) launcher.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        // Create default actions
        Resources res = launcher.getResources();

        mItems.add(new ListItem(res, R.string.group_shortcuts,
                R.drawable.ic_launcher_shortcut, ITEM_SHORTCUT));

        mItems.add(new ListItem(res, R.string.group_widgets,
                R.drawable.ic_launcher_appwidget, ITEM_APPWIDGET));

        mItems.add(new ListItem(res, R.string.group_live_folders,
                R.drawable.ic_launcher_add_folder, ITEM_LIVE_FOLDER));

        mItems.add(new ListItem(res, R.string.group_wallpapers,
                R.drawable.ic_launcher_wallpaper, ITEM_WALLPAPER));


As I mentioned earlier, each application is implemented differently and the problem I had now was just a Java refactoring, as I had implemented my events differently. In the end, it payed off and I could implement my own custom dialog. That shows how awesome Google Code Search is! I will take that route the next time I need to implement similar functionalities to my Subversion Edge Android Discovery Client and other future apps.

Subversion Edge Discovery Android Client - Custom Dialog with Icons

%d bloggers like this: