Develop an android application to display all the data types in object-oriented programming using FrameLayout

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:padding="20dp"
    tools:context=".MainActivity">
    
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:text="@string/string_data_types"
        android:textStyle="bold"
        style="@android:style/TextAppearance.Medium"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:text="@string/string_int"
        style="@android:style/TextAppearance.Large" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="75dp"
        android:text="@string/string_float"
        style="@android:style/TextAppearance.Large" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:text="@string/string_char"
        style="@android:style/TextAppearance.Large"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="125dp"
        android:text="@string/string_double"
        style="@android:style/TextAppearance.Large"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="150dp"
        android:text="@string/string_void"
        style="@android:style/TextAppearance.Large"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="175dp"
        android:text="@string/string_boolean"
        style="@android:style/TextAppearance.Large"/>
</FrameLayout>

MainActivity.java

package com.example.framelayout;
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">FrameLayout</string>
    <string name="string_void">void</string>
    <string name="string_boolean">boolean</string>
    <string name="string_double">double</string>
    <string name="string_char">char</string>
    <string name="string_float">float</string>
    <string name="string_int">int</string>
    <string name="string_data_types">Data types in Object-Oriented  Programming</string>
</resources>

OUTPUT



"Coding Hub - Learn to code" app now available on Google Play Store