Apps development for Android step by step

Lessons related to TextView

Lesson 1.4: How to change a color of text and background in TextView?

From the previous lesson we know how to display a text on Android device’s screens both using XML layout files and Java code. Now it’s time to format that text. We start with font and background colors, but beside a standard text color there are also other options, like links, highlight and hint colors. Moreover we would check current colors.

Read More

Lesson 1.3: How to modify TextView in Java code (findViewById, setText and getText methods)

We have already presented some text on the screen using layout XML file. This is recommended approach, but if we want to modify that text we have to use Java.

Read More

Lesson 1.2: Keeping text in a dedicated file (why and how to use strings.xml file in Android)

Our first app displays “I’m the best” on the screen. To achieve that goal we’ve used TextView tag and modified its android:text attribute. This attribute could keep a specific text (that we did in previous lesson) or reference to one of strings in a file dedicated for keeping all text.

Read More

Lesson 1.1: My first app: More than Hello world! (TextView tag and android:text attribute)

If you want to create an app displaying on the screen “Hello world!” (a standard text for the first application), just… start a new project in Android Studio. It already includes Hello world! functionality. But what to do to display “I’m the best!” instead?

There are two ways of doing it: very simple and… recommended one (but still simple). Firstly, you have to start a new project or open the one created in Lesson 0 and then find again activity_main.xml file in layout subfolder (you could learn how to open that file from Lesson 0). Now click Text tab at the bottom of the activity_main.xml file window. You should see the code of layout of your first app.

Read More

Lesson 1: How to display and format a text in Android apps

In this lessons set we will write and display some text in Android app.  And then we will make this text look as we wish. We assume that you know how to create a new app project and find activity_main.xml file. Otherwise start with Lesson 0.

Read More