CodeClan weeks 8 - 9: Building an Android app from scratch
I've combined my reflections on weeks eight and nine, as they both concern the same thing - learning Android. It's been an insightful two weeks, packed with learning code and also (cheesy comment alert) learning about myself.
Android can be powered by a few different programming languages, and handily Java is one of them. I wasn't too sure what to expect with Android, but before starting to learn the framework I must admit I wasn't particularly interested in building Android mobile applications.
I suspect my initial lack of interest was due to the fact that I've had an iPhone for the last decade and have hardly any interaction with Android, other than my Kindle Fire which I use almost exclusively to read books. However, that was all to change with two weeks in front of Android Studio.
Spoiler alert - Android is difficult
Week eight was probably my first proper stumbling block in the CodeClan process. I had a bit of a wobble over SQL inner joins in week three, but Android makes SQL table joining look like toy town. I won't lie - I've found learning this framework to be very challenging.
Our introduction to Android gave us the patterns we needed to build rudimentary apps, display lists and understand how to use shared preferences to persist data. We learned how to create activities and link user actions to Java, and how to pull together basic UI layouts for end users to interact with.
I found much of week eight difficult, mostly because Android doesn't behave the way I expect code to. For example, when learning how to create a list view of items, there was no loop in sight - and this to me was a strange and curious thing. You'd expect to see a loop when you are iterating over an array, right? Apparently not in Android Land - it's buried deep under the hood, doing its looping somewhere in the inner machinations of the framework.
Patterns everywhere
It's all about the pattern. Android is enormous. There are specific ways to do specific things, and if you deviate from that pattern, then (in my experience) there is a world of pain to contend with. It was an interesting but frustrating week following Android's breadcrumb trail to get things to work, without really knowing how the breadcrumbs were building stuff.
However, you've got to make peace with not understanding everything. I knew that if I did the thing correctly, then the thing should work. It's an uncomfortable feeling to not really know the inner workings of what you're doing, but this is how we all conduct our day to day lives.
When you put your car key in the ignition, do you know the exact process that gets your engine to start? When you turn on your laptop, do you know what's going on under the hood? Can you explain how a toilet flushes? With four days of Android under my belt, do I need to know how an intent with extras works?
What to do when you find something very difficult
At the end of one week of Android, Cohort E20 was given the opportunity to build a few different things as part of our second project portfolio week. You may recall I built a web application with Ruby and Sinatra at the end of week five, but this time the projects on offer were a bit more varied.
Students were given the opportunity to build some Java projects powered by TDD, or to take on an Android application. Because I found Android so difficult, I decided to do an app so I could try to get my head around the framework properly, deal with the pain of week eight and consolidate my learning.
I chose to create a meal tracking app, partly because I wanted to explore data persistence and partly because I thought a meal tracker was one of the more difficult briefs. What else is there to do when you find something hard, except by choosing a difficult challenge?
It's not just patterns, there are fragments too
My meal tracker app turned into an epic Android saga, and I have learned a huge amount from the process of learning and building at the same time. My Android meal tracker app is the first CodeClan project I've built where I've been figuring things out as I've been coding, and the difference in approach has been marked.
I decided to make my app using fragments (I was the only student using them). I wanted to use a bottom navigation for my user, and Android uses fragments to make this happen. Knowing nothing about fragments led me to believe they would act just like activities, but they are different animals entirely so a significant amount of week eight's learnings couldn't be applied in practice.
I started again with Android and built a meal tracker app from scratch with fragments, data persistence, list views, dialogs, spinners and a few other bits and bobs. I learned almost everything solo, with a few helpful instructors to guide me along the way and pull me out of ditches I had dug myself. I was also given a very helpful tutorial on passing data between fragments by my friend Jon. But, most of my app was built with solo learning. Which is pretty cool.
I will be honest, though. I had a brutal week of slow progress. I had false starts, had to reset my git once and got myself into some great coding messes. The date picker above could possibly be my favourite struggle - an entire day to get two date pickers on one fragment working. Still, there's a tonne to take away in the process of failing...
My git commit record ended up at around 50 commits. That's about half of what I would usually end up with; I spent a lot of time learning how to do things, not writing code. But that's ok, because I learned a huge amount about Android and about myself.
Key takeaways from Android
- It's good to challenge yourself. I found Android very difficult, but decided to do something hard to help bring my learning on and get me more used to being uncomfortable.
- I started my project week feeling totally clueless about Android, and ended it feeling buoyant. After a week of working solidly on the framework, I started to feel like I was understanding things.
- While it was a very painful week, I think I would be interested in an Android development role if my employer was supportive and patient with my learning process. Android is obviously super cool and massively powerful - and with loads to learn there would be plenty to keep me occupied!
- My app doesn't look like much, but I put a lot of effort into building the functionality and I'm pleased I managed to get something working, despite the blocks and difficulties.
- I enjoyed my Android week, despite the pain. I believe this is the closest experience we will have to starting in employment. Successfully building an Android app in one week, using a completely unfamiliar framework and learning a huge amount in the process hopefully puts me in good stead for software dev roles in the future.
One more thing
As time marches ever onward, the hunt for a job is now peeking over the horizon. If you know of any junior software development roles going, I'd be delighted to hear about them! :)