Develop an android application to place Name, Age and Mobile number linearly (Vertical) on the display screen using Linear Layout

In this tutorial, we are creating an android application which will look like as

Let’s start by designing the layout of our Android App.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.linearlayout">
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="10dp"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/tvName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/name"
        android:textSize="40sp" />

    <TextView
        android:id="@+id/tvAge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/age"
        android:textSize="40sp" />

    <TextView
        android:id="@+id/tvMobileNo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/mobile_no"
        android:textSize="40sp" />
</LinearLayout>

MainActivity.java

package com.example.linearlayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

strings.xml

<resources>
    <string name="app_name">LinearLayout</string>
    <string name="name">Name : Suraj Pande</string>
    <string name="age">Age : 26</string>
    <string name="mobile_no">Mobile No. : 9851236547</string>
</resources>

OUTPUT