AniBall goes Bloosy

It was a number of years ago when I first wrote a very simple Java applet which animated a few solid blue circles in a small box in your web browser. I called it AniBall, and I still have the source code somewhere.

That exercise was important to me for a boatload of reasons.

For one, it was my introduction to object-oriented programming. I remember being very confused by it at the time because it seemed like everything was just a series of new statements and parentheses. In hindsight, this was probably also the first glimpse I had into the importance of the API over the language. In my previous procedural programming everything was about simple statements used to express logic that I created and understood. In new-fangled Java applets everything depended on opaque APIs built around objects and I didn’t get to see where the fundamentals resided anymore. My logic took a back seat to assembling someone else’s components in tricky variations. It took years before I got back to a point where I could respect myself enough to write procedural code.

AniBall was also important because a guy I respected a lot gave me the most under-stated compliment you might imagine. He said it was “soothing” or something like that.

The applet didn’t do much. It just painted a solid blue circle on the canvas and then animated it by letting it bounce off the edges – kind of like Pong works. There was some mechanism for introducing new balls to the animation too, I think you would just mouse-click somewhere in the canvas. And after a few clicks there were a few of these soothing blue balls bouncing around the web browser.

Fast-forward to today, when I am in the midst of learning how to program on the Android operating system. The AniBall concept, simple as it may seem, has been on my mind’s back-burner for more than a decade. But I see now that there is some other game or something out there with the name “AniBall” – so I decided to name my new application as “Bloosy” (sort of a take-off on “bluesy”).

For now, I’m just figuring out how to get everything built and deployed onto my Android phone, and to get it published in the Google Play store. But I’ve got a whole bunch of neato ideas for things to add to my mobile app. To a great extent, it will be a playground for me to learn Android OS concepts and techniques. You can check-out the code on GitHub, and if you’re polite I might even add you as a contributor to the project.

The bigger picture is that I’ve always been fascinated by visualizations. And I’ve been thinking a lot about how interesting it would be to use a mobile device as a tool to visualize data based on information signals gleaned directly from your immediate local environment.

For example, your phone has a latitude and longitude. That can be visualized as some sort of animation – maybe as a number or as a modification to one of the blue balls based on those numbers, or as a speed vector or a shading of color. Your phone has access to other local inputs too – e.g., number of unread emails, time of day, something about a news headline, free memory, whatever. All of these might be items of information that normally go unnoticed but which could be interesting to see as a visualization of some sort. A way of more deeply immersing yourself in your environment by SEEING something that is normally not seen.

I know that’s abstract, and my elevator pitch is not quite yet… pitchy. But as I work on the project it will become more coherent. And I am betting you are going to enjoy some aspect of the finished app!

Where’s Visual Basic 6 for Android?

I’ve been using the Android operating system pretty much since Day #1. When the original Google Phone was announced, I think I bought it within the month. It was released on the T-Mobile network as the G1 and boy was it snazzy. For me, that was a no-brainer.

A little later I upgraded to the G2, got a Samsung Galaxy Tab (this was a mistake) and then my current Samsung S3. Aside from the Galaxy Tab 10.1 table, I’ve been very happy with each one. Everyone involved has done a great job on the operating system, on building a vibrant hardware market, ensuring a steady stream of apps (maybe not as great a selection as the iPhone has, but certainly nothing to sneeze at).

A couple of times over the years I’ve thought about working on some mobile apps for Android myself. I’ve got a few ideas both for programs that I would find personally useful and also for ones that could have some widespread appeal. I’m a programmer by trade (and a technology generalist), so it shouldn’t be a huge leap for me to do this. And while I’ve been dinkering around thinking about building on mobile, a friend of mine (who is not a programmer) has actually built several apps for iOS by commissioning a freelance hired-coder.

There are a few (real or imagined) obstacles for me. One, I rarely feel like I have enough time to focus on a new subject area outside of my core professional work or my home chores and obligations. And when I do think about a new focus there are so many diverse interests and competing wishlist projects that I often don’t get started deeply enough on any of them to make any impact. And then there’s the tools.

I’ll say it. I think Android development tools suck. And having gotten glimpses of several of them over the years and seeing how they’ve matured in minor ways, I think it’s amazing that the Android platform is as consumer-friendly as it is.

I know, that says more about my incompetence as a programmer than anything else. But the truth is, when I get started with a new platform I want there to be the equivalent of a Visual Basic 6 IDE available. I know that makes me sound spoiled, but I know how many outrageously talented programmers there are out there who can produce just that sort of tool, so I’m just saying that I want them to have already done it for me! 🙂

So I can focus on what platforms and programming languages are really for – building interesting applications and interesting solutions to problems people care about.

The tools environment doesn’t have to be dirt-simple. I mean, I’m willing to make more effort than your average Word macro programmer. Google’s App Engine might be a good model environment to look at: There’s a lot of complex technology going on, and it definitely takes a little effort to get things rolling, but you can start producing some snazzy web applications pretty darned quickly, and out of the box they come with all sorts of advanced features like scaleability, redundancy, security, etc…

But when it comes to Android, the first thing you see is… You’ve gotta install the Eclipse IDE. And once you install that you’ll wish that your widescreen monitor was the size of a football field because otherwise you won’t be able to find anything in the busy mess of a user interface.

Don’t get me wrong – I’ve grokked enough of the Eclipse environment to have a hunch that it is incredibly powerful, flexible, and probably well-liked by people who have had better reasons than me to get used to using it. But if you look at it as a gateway drug to Android development, and then compare it with Visual Studio playing the same role in .NET / C# development… it’s just not in the same ballpark.

Eclipse as a tool is hard, and this has nothing to do with the fact that it is intended primarily to support Java.

My daily technology life is already hard, and when I try to explore a new platform I want (need!) a reasonably simple way to get past the mental obstacles. After all, in nearly every case I am just exploring, and not yet knowing whether it is something I want to spend lots of time on going forward. I do that about ten times in an average day, with a widely varying bunch of tech tools.

You might say that App Inventor is what I’m looking for, and then smirk and behind my back tell people I should really be programming in Turtle Graphics.

But App Inventor – while cool – first of all has its own brand of horrendous clunk, and most definitely certainly is not the equivalent of Visual Basic for Android.

Visual Basic, whatever you think of Microsoft or anyone who uses it, is a powerful language that is essentially without any limits, and is also a powerful prototyping environment. The fact that Microsoft tried to kill it many times as it introduced .NET (and failed to do so) speaks volumes about its usefulness. It’s still around, and will be in various forms for the foreseeable future.

App Inventor is like Turtle Graphics.

It’s awesome that the folks over at MIT are working on App Inventor. But it just doesn’t give me what I’m looking for. I think it is great for prototyping.

I continued to look around. I found Xamarin. Develop for any mobile device using a .NET language. That sounds awesome. I installed it and started playing around and it was super-simple to get something up and running and packaged and installed on my S3 phone. You might think this is because it lets me use C#, and at first I thought that was the reason. But it’s not. Actually, using C# in Xamarin is more of an obstacle than anything else since as soon as you start searching for code samples to do things like animation on Android you’ll find that most of the forum posts and SDK documentation are written in Java. So C# development on Android is not a big help.

But you know what is? They implemented Visual Basic. They got the essence of the programming language gateway drug and made it easy-peasy to get my Hello World app running on my mobile device. Not by handing me a magical C# development environment, but rather by handing me an IDE that takes care of all the zillions of quirky resource files, paths, debug tools, etc., ad-nauseum that a functioning Android development environment requires, just to get Hello World to run.

Xamarin doesn’t have the extreme flexibility of Eclipse. It certainly doesn’t do C# as well as Visual Studio. It doesn’t give me that watered-down Turtle Graphics experience like App Inventor. But never mind the language, it does everything that an IDE is supposed to do. It gives a compelling reason to us the tool instead of simply writing your application in Notepad and compiling it from the cmd.exe prompt, which is a not too far-fetched alternative.

So now I have a choice. Do I use Xamarin and figure out how to do all the Android platform stuff in C# code? Or do I fuss with all the scruff and figure out how to get Eclipse or maybe the JetBrains IntelliJ IDEA working without all the seemingly random errors about my screwy environment?

Oh, IntelliJ IDEA. It’s another option I’ll explore. But we are already at the end of this post.

Right-Click is Your Friend (Thanks for Context Menus!)

A computer mouse
A computer mouse (Photo credit: Wikipedia)

I have always been a big fan of self-documenting systems. I mean, systems which teach you about themselves as you use them. There are some great examples in various areas of technology, but my fondest memory will always be of the ubiquitous “right-click” in Windows, which brings up the context-sensitive menu. I used to tell my users, any time they couldn’t figure out how to do something in Word or Excel, to just point to the general area where they wanted to do something and hit the right-click. Chances are the menu option would magically appear before them.

I think that feature has been in Windows since Windows 95.

BlackBerry also became a master of the context-sensitive menu, and it allowed them to design an interface which could be mostly operated using a single rolling input device, coupled with a series of nested menus to perform pretty much any function.

The Android operating system also incorporated this feature heavily – except here it took a long-hold on the touchscreen to bring up the context-sensitive menu.

And of course, Linux was always a master of this with its collection of “man” pages for the entire command shell library of utilities.

Mac… Oh, Mac – I feel like with Mac you just have to know where things are, there’s not much help as far as self-documentation. For years, the Mac did not come with a right-sided button on the mouse, so there were not any context-sensitive menus, so far as I know.

Who knows – I’m a PC / Windows guy. Maybe Mac has always had something similar but I couldn’t figure out where to find it.

Enhanced by Zemanta