android apps, learn android programming, android for beginners, android
NEXT Page - Android App Coding - res/drawables Tutorial PREV Page -Android App Coding - res/layout/Main xml Tutorial Android For Beginners- Read the Article

The code in these free Android tutorials is from AIDE - the free Android App for Creating Android Apps.
The programming language is JAVA XML


Resources Values Strings xml Tutorial

res/values/strings.xml
To locate this file in your android app project files goto:
AppProject/nameOfApp/res/values/strings.xml
nameOfApp is the name you gave the app when creating the AppProject

When you create a simple pre made template in AIDE, these files are created for you. Each app you create must have at least 1 activity, and within that activity there is a text view. Within this text view is where you place the text you want shown in your app. (essentially a text view is like a web page view, although a text view is a tablet screen size not a computer screen size)

To code the text you want shown in each text view, you use a string. These strings are coded then placed in a file called "strings.xml". The strings.xml file is at folder res/values/strings.xml

You can have as many strings as you want for whatever you want; from titles, words, paragraph headings, photo descriptions; basically whatever your app is about and the text required for it.

If your app has more than one activity (one page) then each additional page needs a text view, and that text view would also need strings.xml to add text to the page.

res/values/strings.xml Res Values Strings xml Tutorial Android Apps

Looking at strings.xml image; we see there is s string named
androidTutorialsIntro and that the wording/text for that string is Learn Android For Beginners

There is also a string named
app_name and the wording/text for that string is
Learn To create Android Apps- AndroidAppCoding.com.

Looking at this next image: androidmanifest.xml
We see the android label has a string named 'app_name'. This is the name you give your app and it will show at the top left of your screen next to the app's icon. To code it we must place the 'text' we want shown into the strings file as shown in the previous image.

The app_name is also shown in the androidmanifest.xml file; in the application and activity elements; as shown in this image.

androidmanifest.xml



The main.xml is a file that has the textView particulars, the attributes for each coded property. Example, you may want the text to be centered in the textView, to be a certain size, bold or not bold, italic or not, text color; all of these are coded in the main.xml file for each property you add as shown in this image.
Res Layout Main xml Tutorial Android Apps

Let's look at the particulars of the code in the 'TextView', of this image. We see the textview properties and their attributes: the text is to be wrapped, the text should be 10dp from the top of the TextView, the text size is 25dp, the typeface is "sans", the text color is #46C646 (green), the text color link is #eeefff .

And, any domain names should automatically be hperlinked; autoLink=web example; if androidappcoding.com is placed in the text view string, not only will it show as text, but it will be clickable also.

android:text="@string/mathintro", means there is some Text to be placed in the screen view for this activity. To see what is text is; you would goto the strings.xml file and look for mathintro, which you can see by looking at this image is - PreAlgebra Learn Equations.
string Math Intro, android apps

Your Android App will be updated with the newest text you add or edit - just makes changes to the strings.xml file and then RUN your app.


Share This Page

AIDE for creating Android Apps on your tablet or cell phone(android).
Free and Paid - with Free, create simple template apps and couple free android lessons.
With paid, many android lessons included, create template apps, publish your app at markets like Google, Amazon, and get a 'keystore' for your app.

GoTo Aide

ANDROID STUDIO - for creating Android Apps on your desktop computer.
Free to Install and Use

GoTo Android Studio Learn more - Android Studio

The Java XML files we code(example tutorial codes) and the Android Apps we create in our Free Tutorials are compatible with Android Studio and AIDE. Just choose Java XML as your Programming Language.


The Google Play Store has many Free Apps for learning to code Android.

Do A Google Play Search
"Learn Android, Android Programming, Android Development,Learn Java XML "



You May Like:
Make Sushi Rolls Taste World Wines Flavours and Aromas
To Copy Code Use Mouse

This free script provided by
JavaScript Kit