Interactive Dashboard: Android First Impressions

Over the years I’ve coded in almost every programming language under the sun.  Languages all the way from Turing, Object Pascal, C#, Java, HTML5/CSS, JavaScript, C++, QML.. you name it.  But over the last 5 years or so I’ve been concentrating my hands-on coding experience on web development using HTML5/CSS and JavaScript.  I understand browser engines, the DOM and CSS inside out and can create pretty much any layout and visual effect that I can dream up.

But starting on the Interactive Dashboard I’ve decided to go with Android as the operating system and utilize “native” Android Java development.  In the past I would tackle Android by leveraging HTML5 development with PhoneGap packaging for Android, but for this implementation I need to get integrated down into the operating system.  It will require talking to ODBII ports and Arduino boards via USB, updating system settings, embedding native Google maps and turn by turn direction views from Android etc..

While many of those tasks are possible by building PhoneGap plug-ins, I’m positive that the majority of my code will be in those plug-ins and not in the UI layer.  So I might as well also build the UI layer in Android as well since I’m not trying to port this code to other operating systems.

Tooling

All of the components that I plan to use have good integration points with Android so I’ve had to dust off my Java skills and dig into the Android development environment.  I am however glad to see that Google decided to build their own IDE on top of IntelliJ.  I’m one of those folks that just doesn’t like Eclipse.  That’s right, I said it.  I’ve always been more of a Visual Studio or Notepad++ guy during my development career.  Eclipse just seems like it has a million different settings that I can never find.

After working on the interactive dashboard app for 3 afternoons I’ve been able to gather some first impressions.  The tooling so far is pretty good.  I haven’t had to try and do any advanced debugging but the tooling has been pretty straight forward.  However figuring out how to put an Android device into developer mode was a bit of a weird experience by tapping in a certain area of the device’s about screen X number of times… Strange.

I have noticed that I’m doing what I expected in the tooling, which is not looking at the design view at all.  I used it for all of 5 minutes before I was “Googling” what mark-up I needed in the XML to get the desired look.  I’ve always found WYSISYG editors to be more of a marketing checkbox than a very useful long term feature.  At best they are a learning tool to get you to a point where you no longer need to use them.

Also as expected the simulators take up a ton of memory and slow down your computer.  Launch times are slow as well, and nothing beats having a device plugged into the computer via USB for actual testing.

 Layouts, Styling and XML Mark-up

This was an area that took some time to get used to.  I’m sure that I’ll be continuing to learn the ins and outs of this stuff for quite some time.  Coming from using <div>’s and CSS mark-up to style user interfaces, my initial impression of the android XML mark-up and style properties was that it’s pretty convoluted.  All of the the namespace prefixes seem to get in the way and are a bit redundant.  I get it… it is standard XML extensions, but it seems much less elegant than purpose built mark-up like HTML, QML, XAML or even using just good old plain JavaScript object/JSON definitions.

markup

The styling properties were equally strange to get used to.  Yes you can set standard properties on different elements by using declared styles, but trying to do simple things like draw borders, shapes and colors has yet a different way of accomplishing the task.  To do these simple changes you need to create drawables that can be layers, shapes and lots of other things that can customize the look of a component.  While I’m starting to get the hang of this, it seems difficult to get started with.  I’m just hoping that as I go along it reveals that it is more powerful and flexible this way, I just haven’t seen it yet with my limited exposure.

Layouts were another interesting adventure.  Trying to figure out all the different layouts, sizing, spacing etc has been hours of “Googling” trying to figure out how to position items in a manner that I was able to crack off quickly when I was using CSS.  I’ve been stumbling my way through layouts but have been slowly gaining a grasp on how they work and discovering the “magical” properties that do things like setting a size to “0dp” and a weight of “1” so that they magically are evenly sized and distributed in a layout.  You know.. those obvious properties.

App Progress

Over the last 3 afternoons I’ve been able to get some of the basic layout for the app mocked up.  Mainly consisting of a top button bar menu and two view panes below it.  I was also able to get a start on plumbing in the web view, address bar and progress bar.  So there’s still a long way to go but at least I have a start and I’m learning more about Android mark-up, layout and styling every day 🙂

Screenshot_2014-12-10-18-28-52

Advertisements
%d bloggers like this: