Whats up Geeks,
In the last tutorial we have learned Adding a Text Field.
In this tutorial we are going to learn Adding a String Resources.
So the question comes what is the use of String Resources addition?
And the answer is :
When we need to add text in the user interface, we should always specify each string as a resource.
Now the question arise what this String resources do?
And the answers is:
String resources allow to manage all UI text in a single location, which makes it easier to find and update text. Externalizing the strings also allows you to localize your app to different languages by providing alternative definitions for each string resource.
Where does these String resides?
By default, your Android project includes a string resource file at
Add a new string named
While you’re in this file, also add a "Send" string for the button you’ll soon add, called
For example:
The result for
That's all for today. See ya tomorrow with some new learnings.
In the last tutorial we have learned Adding a Text Field.
In this tutorial we are going to learn Adding a String Resources.
So the question comes what is the use of String Resources addition?
And the answer is :
When we need to add text in the user interface, we should always specify each string as a resource.
Now the question arise what this String resources do?
And the answers is:
String resources allow to manage all UI text in a single location, which makes it easier to find and update text. Externalizing the strings also allows you to localize your app to different languages by providing alternative definitions for each string resource.
Where does these String resides?
By default, your Android project includes a string resource file at
res/values/strings.xml.Add a new string named
"edit_message" and set the value to "Enter a message." (You can delete
the "hello_geeks" string.)While you’re in this file, also add a "Send" string for the button you’ll soon add, called
"button_send".For example:
The result for
strings.xml looks like this:<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Hello Geeks</string> <string name="edit_message">Enter a message</string> <string name="button_send">Send</string> <string name="action_settings">Settings</string> <string name="title_activity_main">MainActivity</string> </resources>
That's all for today. See ya tomorrow with some new learnings.
This blog post is very helpful and informative. The examples make the information easier to apply. Thank you for sharing these insights.workday hcm course
ReplyDeleteInformative post! OpenShift Red Hat training is a great way to gain hands-on experience with Kubernetes, container orchestration, and DevOps workflows. It helps learners build practical skills in deploying, managing, and scaling cloud-native applications in enterprise environments.openshift redhat training
ReplyDeleteAn iOS development course provides complete knowledge of designing, developing, and deploying applications for Apple platforms. This ios development course covers development tools, coding standards, and application architecture. Learners gain hands-on experience through practical assignments and projects. The course prepares students for successful careers in iOS application development.
ReplyDelete