July 2015
Beginner to intermediate
600 pages
18h 59m
English
Next, create your interface. First, add a string for your search button in res/values/strings.xml.
Listing 31.1 Adding search button text (res/values/strings.xml)
<resources>
<string name="app_name">Locatr</string>
<string name="search">Find an image near you</string>
</resources>
You will be using a fragment, as usual, so rename activity_locatr.xml to fragment_locatr.xml. Change out the insides of its RelativeLayout to have an ImageView to display the image you find (Figure 31.7). (The padding attribute values come from the template code as of this writing. They are not important, so feel free to leave them out.)
Figure 31.7 Locatr’s layout (res/layout/fragment_locatr.xml)
You also need a ...
Read now
Unlock full access