06. “strings.xml”

The third file we need to understand is “strings.xml“. When you open it, you will again have multiple tabs to choose from, simply move to the “strings.xml” one and you should see something like this:

This is not the only way you can incorporate strings into your Application but it does allow you to separate that aspect from your UI and so we’ll stick with it for now.

At this stage we just have two strings being used by our app and all I want to do is change the “hello world” reference to be more meaningful, i.e:

<?xml version = "1.0" encoding = "utf-8" ?>

<resources>

    <string name="heading"  >The BlackJack App!</string>
    <string name="app_name" >BlackJackApp</string>

</resources>

Notice that I’ve renamed the string that was called “hello” to “heading“. This now means that the reference to this string that exists back in “main.xml” needs fixing so make sure you do that.

Leave a Comment

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>