The default project template has probably changed since the writing of the book.
Try creating a new project, and when asked, select "Empty action" instead of "Empty action." This should include only activity_main.xml
This does not include the hello_world line in the resources, so just add it yourself by adding a line with
<string name="hello_world">Hello World!</string>
in strings.xml
In addition, they decided to break the agreement that they were going to use for the default template. There is a TextView activity_main.xml layout, but it uses a string chain, not a string resource.
If you change the text attribute of this TextView to: @string/hello_world , you can reflect the desired behavior that the book requests.
Here is a page right from the official Android docs on String resources. This may help you better understand: https://developer.android.com/guide/topics/resources/string-resource.html
source share