Google+

Android4Beginners.com

Apps development for Android step by step

Lesson 1.5: How to color part of the text and use alpha channel in TextView?

Let’s say that we want to have every word presented in TextView in different color. Any of solutions from previous lesson doesn’t address this issue, but we know how to do it. And there is one more thing related to colors – so called alpha channel that’s responsible for transparency.

Read More

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