January 2017
Beginner to intermediate
624 pages
22h 42m
English
Time to create your interface. First, add a string for your search button in res/values/strings.xml.
Listing 33.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 33.7). (There are padding attribute values that come from the template code as of this writing. They are not important, so feel free to leave them or delete them.)
Figure 33.7 Locatr’s layout (res/layout/fragment_locatr.xml)
Read now
Unlock full access