Time for action - creating a recipe viewer application
You'll notice that the following example doesn't use an XML layout resource, but rather creates the entire
Activity in Java. In this example we use a
Recipe object to generate HTML code into a
StringBuilder for display. It's a simple but effective implementation. However, it requires that the Java code be modified if a change to the look and feel of the recipe is required.
- Create a new project to contain the recipe reader application:
android create project -n RecipeViewer -p RecipeViewer -k com.packtpub.viewrecipe -a ViewRecipeActivity -t 3
- Create a new
Ingredient.javasource file in the root package of the new application to hold information for a single required ingredient, and open this ...