Trisha has developed Java applications for a range of industries, including finance, manufacturing and non-profit, for companies of all sizes. She has expertise in Java high performance systems, is passionate about enabling developer productivity, and right now is getting to grips with working in an Open Source fashion as a developer for MongoDB Inc, where she contributes to the Java driver and Morphia. Trisha blogs regularly on subjects that she thinks developers and other humans should care about, she’s a leader of the Sevilla Java & MongoDB User Groups, a key member of the London Java Community and a Java Champion - she believes we shouldn't all have to make the same mistakes again and again. Trisha is a DZone MVB and is not an employee of DZone and has posted 67 posts at DZone. You can read more from them at their website. View Full User Profile

My Experiences with Android Development

  • submit to reddit

Because I was missing coding, and because my friend and I had an awesome phone app idea at the weekend, I thought I'd try my hand at developing an Android application this week.

I want to give a quick overview of my preliminary thoughts on getting started on this endeavour.

Background: I've got more than 10 years Java experience, but any UI for the applications I've worked on was always a web UI.  I am completely new to mobile app development.

Getting Started
I spent maybe a day and a half reading the excellent Android developer documentation and attempting to hack out a quick 'droid app.

I was surprised to find the Application Fundamentals section actually made sense to me.  There appears to be a clear architecture with design guidelines laid out for developers to follow.  This shouldn't really be a surprise I suppose, but years of hacking around with web UIs with poorly implemented MVC architectures must have left me thinking that all frameworks are less "frame" and more "work".

I remember the disaster of trying to get my first JDK working on my 486 - what a nightmare!  And getting Tomcat 3 installed and running?  Forget it.  I also remember the last time I made a serious stab at a learning a new technology.  I tried develop a Grails/Groovy application in Eclipse.  The IS guys had to rescue my laptop from me during that enterprise before I could do it any serious damage.

Installing the SDK on my mac was surprisingly simple, especially bearing in mind I'm new both to OSX and to mobile development.  I don't know if it's because Android development has been well thought out and well supported, or if it's a function of both the industry's maturity and my own experience.

The integration with IntelliJ was much slicker than I expected, especially since I'm using the freebie Community edition.  I don't remember the exact steps to tell it I wanted to create an Android project, but it must have been ridiculously easy otherwise I would remember the trauma.  I do remember a little confusion around installing the Android platform - I hadn't understood the difference between installing the SDK and then installing a specific API for it.  But the documentation and the android application got me on the right track in the end.  And then when I clicked the "run" button in IntelliJ, hey presto!  The emulator appeared and there was my app!

I loved the emulator.  I had some confused idea that I would have to plug my own phone into the laptop to see my application.  Instead, the emulator looks enough like my actual phone to give me decent feedback on how the app is going to behave.  The downside is I was trying to play with the camera, and I couldn't see how that would really work in the emulator, but I got a fair idea.
Did it work?I managed to get a rudimentary application running, with a button and some descriptive text (it's not about to win any awards).  The button was supposed to launch the camera viewer, but my first few attempts just resulted in the crash notification.  It didn't take long to figure out how to use logcat to see the stack trace and see I hadn't set the permissions correctly to use the camera, so I rooted through the CameraPreview example in APIDemos to figure out how to set up the AndroidManifest.xml correctly, and rather amazingly it all worked!
Any downsides?I was surprised (and slightly disappointed) at the amount of XML configuration.  I've seen plenty of evil Spring and Ant XML in the enterprise and I thought frameworks were moving away from that.  The manifest I can understand I suppose, but it felt a bit weird to be defining the UI in XML.  It seemed like a bit of an afterthought tagged on after all the well-defined architecture behind the scenes.
But maybe this will make more sense to me as I develop my application further.
In Summary
  • I was pleasantly surprised to be able to get an Android application (albeit a very basic one) working in only a few hours.
  • Development in IntelliJ was much easier than I expected.
  • The documentation is actually very good.
We'll see how I feel about it when I start trying to do more than a very simple example application.



Published at DZone with permission of Trisha Gee, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)



Otengi Miloskov replied on Tue, 2011/07/26 - 7:55am

Very nice article and yes Android is awesome. About the GUI XML programming you dont need to use xml to define the UI you can define your GUI in plain Java as with Swing, check the docs is very easy. If you used Swing you will feel more confortable with the Java code.

Trisha Gee replied on Tue, 2011/08/09 - 3:56am in response to: Otengi Miloskov

I guess I used XML because I've been using Spring config, and I've never developed in Swing (unless you count university projects). I would definitely look into the Java GUI if I did any further development.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.