The purpose of this tutorial is to add an Android user interface to the HelloRepo example. In this tutorial you will add the ability to display a list of nodes in a list view.
There are several stages to this tutorial:
- Create a new project to work with.
- Create a node adapter. List views are interfaced to an adapter in order to display results. You will create a custom adapter, the node adapter, so that the list view can display information from a list of nodes. Although the list view will only display the node name, it could easily be extended using this approach to display additional node information.
- Create a list view component. Once you have the node adapter class, you can attach it to a list view component to display a list of nodes.
- A MessageObject class is created. This is a Parcelable object that can be sent between two activities. This message object will contain details of a node selected from the list view.
- Add a node detail activity to HelloRepo. Once you have nodes displayed in a list view, then the next step is to add code to enable a node in the view to be clicked. Once a node is clicked a new activity is displayed, the node detail activity. This activity displays additional information about the node.
- You need to add code so that when a node is selected from the list view, an Android intent is created containing the selected node. This is then sent to a newly created node detail activity, which displays the node information.