According to Android’s own documentation, there is no documentation for styling Android. You’d think with the power of Google and huge market penetration, the Android team with have the commitment by now to document their code and features, but that’s another story. So what does Android officially say about styling? “Go read the source code.” Well, that’s a terrible stance and it leaves a developer guessing for hours, days, and even weeks. The things I’m going to share in this post took me quite a while to learn and I wish someone showed me early on. They will speed up the process and allow your styling to be more flexible to change. The rest of this article will talk about setting up a default theme to globally style your application. [Read more →]
Styling Android With Defaults
January 8th, 2012 · Android, OOP, Styling
→ 6 CommentsTags:Android·Design Patterns·flexible android·OOP·Styles·Styling
Android Architecture: Part 9, Conclusion
December 29th, 2011 · Android, OOP
In the previous 8 articles we discussed in-depth all parts to setting up a well-architected Android project. This post will mostly be some of my general thoughts about our project Tap Counter, MVC in Android and what’s next for this blog. [Read more →]
→ 9 CommentsTags:Android·Design Patterns·Model·MVC·OOP·View
Android Architecture: Part 8, State Pattern
November 27th, 2011 · Android, OOP
This is the part where I address what’s happening in TapController that I’ve been avoiding until now. Unlike MVC and DOAs, I wouldn’t consider the State Pattern to be an essential part of Android architecture. However, it certainly is rad and it can do some cool things. Between that and because I’ve used it in TapController when dealing with messages its worth taking a moment to discuss. [Read more →]
→ 3 CommentsTags:Android·Design Patterns·OOP
Android Architecture: Part 7, Persistence
November 26th, 2011 · Android, OOP
We’ve made it through all the hard stuff. If you can do MVC in Android, the rest of this series is going to easy. Grab a beer and reward yourself and let’s talk about data persistence.
I’m going to assume you already know about sqlite and other persistence features in Android. If not, now is a good time to go check that out. I’m going to suggest a concept known as Data Access Objects or DAOs. The idea is super simple: we pass a model to an instance of a DAO and it saves, updates, or deletes for us. So instead of having tons of sql spaghetti string queries all over the place, it’s all done through the DAO. Seems easy, right? Right. Let’s check out some code. [Read more →]
→ 2 CommentsTags:Android·Design Patterns·OOP
Android Architecture: Part 6, Putting it Together
November 25th, 2011 · Android, OOP
So far we’ve discussed Models, Views, and Controllers. And now let’s discuss how we stick them together to make 1 cohesive unit of the MVC paradigm.
The Activity is our entry point for each new view of our application and it’s in the onCreate() method that we will need to instantiate our model and controller. In a typical MVC the view does not create these but, eh, what can you do. Once the model is created, we need to register the activity as a listener. And additionally, if you want to receive messages from the controller, you can register it as well. Let’s take a quick look at what that looks like. [Read more →]