Several people ask me about tips for learning new programming languages. Here, we talk about some of the broader concepts in learning a language.
Today we continue our lesson on Activities and Intents. In Part One of our discussion, I explained how to switch Activities within a single application. This time, we’ll discuss how to launch an Activity belonging to another application. I will use as an example some code from my work with the OpenIntents FileBrowser. Check out the Read More!
Today we’re going to do some fun Activities together! Perhaps it would be more fair to say that we’re going to have fun learning about Activities. In Android! In this article, I will explain the Activity model, how to use it, and tell you why I like it. Interested? Check behind the Read More!
This episode of Nuts and Bolts puts us back on course with what I had originally planned as N&B 3 – “Threads, or, How to Not Blow Up Your New User Interface”. We’ve already discussed how to make a UI, and we’ve talked about how to make it work. The next logical step is to learn how to make our application do something meaningful. For simple applications this may not mean using threads, but any time your app needs to A. sit around and wait for something, or B. do intensive computations, you will need Threads. Become an Android sewing master by clicking the “Read More“!
Android: Nuts and Bolts IV could easily be titled “The Right Way To Do Android: Nuts and Bolts III”. Since writing my last entry discussing Relative versus Linear Layout, I have made an important discovery! Table Layout actually solves the problem much better than my previous hokey tinkering did. (In fact, just bookmark that page, or print it out and frame it or something, it’ll save you a lot of time.) I also learned some really cool stuff about phone orientation changes, alternate layouts, and alternate resources in general.
For a more detailed description of TableLayout and other neat stuff I’ve learned since N&B III, check behind the Read More cut.
In this Nuts and Bolts entry, I’ll be discussing user interaction with User Interface elements, and how to code for it. Examples of most of these can be found in the Notepad Tutorial. There are several pieces of UI functionality that can be coded for, but the simplest and most obvious is the notion of “making the buttons work”. I imagine that, for most people new to Android, the obvious next step after laying out a fancy UI is to actually do something when the user interacts with it.
Check out the read more to find out how to do this and other UI related things!
In my first real “Nuts and Bolts” entry, I’m going to discuss User Interface design. To avoid some redundancy, I ask that readers first work through Google’s Hello Android and a few of the Hello Views tutorials. These will give some familiarity with how to actually get Eclipse talking to Android, as well as teach a bit about the widgets available. What I intend to teach in this tutorial are the things that I didn’t find immediately obvious when going through the Google ones (though in my opinion they are actually pretty good).
Most of my posts up until this point have avoided a real discussion of the actual code behind my Androids apps. I didn’t want to bore anybody with details they didn’t care about; but since it seems like some people do care, I’ll start sharing some Android coding tips! I also had the realization that if/when the lab has to replace me with another Android coder, that person may benefit from what I blog. Bus factor++ indeed!
Before I delve too far into things, I feel it would be worthwhile to think about some structure to this series of blog entries. For today I will blog some of my fresh discoveries, lest I forget them in typical programmer fashion! In the future, I will try to write a couple of entries a week with guides and gotchas written out for future Edwardslab (or any other) Android coders. Without further adieu, I shall explain a bunch of knowledge that just kicked my butt for the past couple of days! (See the Read More cut for random knowledge)
One of the main things that came out of my Android tinkering today was knowledge of multi-threading. The threading technique used in GenomeSearch had ‘multiple’ threads as well (2), but the implementation was a bit lacking. Without going into too much detail, GenomeSearch has one (main) thread which manages the User Interface, and one background thread that blocks on network I/O. Unfortuantely, the implementation is such that if we had ever needed a third thread, we wouldn’t have been able to add it.
So, with a little help from this conversation on Android Beginners, I wrote up a little snippet to test running multiple background threads in addition to the main UI thread. You can find the code behind the cut (note that you will need to set up all of the other project files for this to work (layout, manifest, etc).