2010
My last few Android development posts have been kind of long (took long to write anyway), so here's a short one...
My last few Android development posts have been kind of long (took long to write anyway), so here's a short one...
In my last post, I talked briefly about how the R.java file, a resource file located in the "gen" folder of your Android application project that is automatically generated and updated by Eclipse and serves as a resource map. My example code demonstrated how you could reference layout.xml files via the R.java file and how Eclipse would register the id of the UI objects within the R.java file as well.
I also mentioned that the layout XML files for your Android app are located in a "layout" folder within the "res" ("resources") folder. There are other folders under the "res" folder as well, and the content within those folders is also registered with the R file, allowing you to access those resources within your Android code.
In my last post, I promised to show how I would attach my simple example layout to an Activity object and make a change or two.
In my last post, I alluded to the fact that you can lay out your visual elements and controls on your Android application screens (your Activity objects) using XML. In this post, I'm going to give you a peek at what that XML looks like.
Android applications can be constructed from four different types of components: activities, services, broadcast receivers, and content providers. Of the four, the only one that you must use at least one of in every application (and the only one that I've had to use so far) is the activity.
I'm not going to even try to give a full explanation of what an activity is: the Application Fundamentals page on the Android Developers site provides a thorough (and rather long) explanation of activies as well as the other three components. So I'm just going to give a bullet-list overview to give you a conceptual overview of what an activity is.
Recent Comments