Structure and Classes
We are going to work with two java classes.
ContactList → This class will extend from ListActivity, this means that this activity holds a list of data, a ListView will be its screen layout. Here contact information will be displayed in a list form.
ContactPage → This will be a normal Activity, here we will show the contact information and we will add two buttons to the “Call" and “Send" SMS functionality.
About the resources we are going to use.
mainlist.xml → This will be the layout we are going to use in the ContactList, it will just be a LinearLayout and a ListView.
row.xml → This will just be a TextView. We will use this in one of the two different implementations we are going to work with.
contact.xml → This will be a more complex page. It can be whatever we want. I mean, we can put the elements we want here, in the order or position we want. It is just to show information for the contact. Want the photo at the top? Or maybe at the left of the information? This will be your decision. One important thing, is to place two ImageButtons, one for the SMS and the other for Calling.
We can search on the Internet, for some good icons, and use them in our ImageButtons in the contact.xml layout.
We can add in our string.xml the static values we want. For example if in the contact page, we are going to put labels on the fields we are showing, it would be interesting to add these labels here, in string.xml instead of writing them by hand.
Name: Jose B. Cortés
The label “Name" can be placed in “string.xml"