A Golden Rule of Android

One of the rules of Android is not to block the UI thread. If you block it, then the UI will become unresponsive, and that doesn’t make for a good user experience. I think I am blocking the thread.

So far my Android experience has not been too bad. I have been conscious of the fact that I don’t really know much about Android and there is a whole lot more to learn. I have tried to know as much about the Android components I’m using as I can, but so far, they’ve kind of resembled things I am familiar with. Activities are kind of like Controllers, Intents work a little like requests, Bundles are kind of like sessions. I have been figuring out how to do things that I know how to do in a slightly different way.

This may not have been the best way to do this. I feel I am, more or less, trying to use Android as a web framework, not as the framework it is. What I have so far works, but does it work in the best way? Does it work in the way an experienced Android developer would do it? Probably not. My lack of knowledge about Android has led me to try and get things working in the best way that I can do them, but not necessarily in the best way that they can be done.

This is because of time, mainly. I’m reading Android Programming and it is really good, I am learning a lot, but I am fitting it around my stories or referring to it when I have no idea what to do. As I get further into it, though, occasionally I see something that I could have used in my Android Tic Tac Toe, had I known about it at that time. This is a little frustrating as I would like to learn as much as I can about this framework, and I feel like by just getting my features working, I’m missing out on some serious learning by not implementing them as they should or could be done.

I’m not going to beat myself up about making mistakes though, I’m learning as I go and that’s fine.

The problem I face now is that I really don’t know how to implement my next stories. I have to use either threads or a task (these may be the same thing, I am not sure yet) to carry out tasks so that I do not block the main thread. I don’t know how to do this. I have never used Threads in any form. I cannot just get it working, I don’t know how. I have to take the time to read and learn, but it’s time that I don’t really have. Maintaining state through rotations took me longer than expected and now I am behind on my stories. It’s not a nice feeling, but now that I have decided that I need to take the time to learn how to do something, I’ve decided I’ll take time to learn the best way to do it, which is a good feeling.

Maybe I should’ve done this from the beginning, and increased my estimations to account for extended research. I don’t know. I guess in the real world, a client doesn’t want to pay for my learning, they pay for features, so that’s what I should be delivering on. So that’s what I’ll to do. So far, this has been one of those weeks where I just wished there were more hours in the day.