Developing with Android

I am really enjoying my development experiences with Android. I haven't set any new records or enthralled millions with the applications that I've put together, but I have learned a lot - which is what I was going for in the first place. As such, I thought I'd periodically share what I've learned. This may end up being little more than privileged glimpses into the obvious, but what else is the internet for anyway?

Don't Fight the GUI

I have programmed on many platforms and operating systems over the years, such as:

  • VAX 11/780
  • IBM MVS, MVS/XA - CICS/IMS
  • Windows 3, 3.1, 95, NT 3.5, NT 4, XP, Vista

(Just to name a few....)

Each time you move to a new platform or operating system you need to adapt to its particular way of doing things. Even the tools you use will change the way you go about solving a problem or presenting information or data collection forms.

When I first started with the Android platform, I brought my Windows GUI mindset with me and struggled trying to get the application to do what I wanted. Things that I thought would be simple to do were completely out of place in this new world.

For example: In a Windows application creating windows, modal and non-modal alike, is a natural, relatively easy thing to do and not a real problem. The user can navigate those open windows and open and close them as needed without (usually) worrying about resources available or what has happened to the ones beneath.

With Android, or I suspect any mobile platform, you need to rethink how you would go about using new windows (or intents). If you create a layered application, there isn't a great way to navigate through it, swapping windows, etc., if for no other reason than the lack of room on which to display everything. Also, you have to be prepared for your application to be paused at any moment (phone call) or possibly shut down and restarted (phone orientation change or memory starvation). Restoring an application that had multiple windows open for various reasons can be very difficult to get it back to a meaningful state - not to mention time and resource consumption.

So, I had to abandon by perspective built on many years of working in the Windows environment and stop fighting the GUI. Once I did that, I better understood how the pieces were supposed to go together and was able to get down to the business of working with the application logic rather than trying to make the OS conform to my mis-guided perceptions.