Lab Detail


Sno Back Back Subject subject date title note
1 1 Back to subject Mobile Application Development Lab - 20A05706 (Lab) July 22, 2025 Basic Android Application Toast Msg Displaying(xml + Java Combination)

 19-07-2025 CSE-B(IV)

Basic Android Application Toast Msg Displaying 

app\manifests\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

<!--    <application-->
<!--        android:allowBackup="true"-->
<!--        android:dataExtractionRules="@xml/data_extraction_rules"-->
<!--        android:fullBackupContent="@xml/backup_rules"-->
<!--        android:icon="@mipmap/ic_launcher"-->
<!--        android:label="@string/app_name"-->
<!--        android:roundIcon="@mipmap/ic_launcher_round"-->
<!--        android:supportsRtl="true"-->
<!--        android:theme="@style/Theme.MyApplication"-->
<!--        tools:targetApi="31">-->
<!--        <activity-->
<!--            android:name=".MainActivity"-->
<!--            android:exported="true"-->
<!--            android:label="@string/app_name"-->
<!--            android:theme="@style/Theme.MyApplication">-->
<!--            <intent-filter>-->
<!--                <action android:name="android.intent.action.MAIN" />-->

<!--                <category android:name="android.intent.category.LAUNCHER" />-->
<!--            </intent-filter>-->
<!--        </activity>-->
<!--    </application>-->

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="My Application"
        android:theme="@style/Theme.MyApplication">
        <activity
            android:name=".Act1Demo"
            android:label="Act1Demo"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>


</manifest>

app\res\layout\activity_main.xml

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

<!--    <Button-->
<!--        android:id="@+id/bt1"-->
<!--        android:text="Android"-->
<!--        android:layout_width="wrap_content"-->
<!--        android:layout_height="wrap_content"-->
<!--        android:onClick="clickAndroid"-->
<!--        android:layout_gravity="center"/>-->

<!--    <Button-->
<!--        android:id="@+id/bt2"-->
<!--        android:text="Java"-->
<!--        android:layout_width="wrap_content"-->
<!--        android:layout_height="wrap_content"-->
<!--        android:onClick="clickJava"-->
<!--        android:layout_gravity="center"/>-->
<!--Old Version-->
    <Button
        android:id="@+id/bt1"
        android:text="Android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="clickBtn"
        android:layout_gravity="center"/>

    <Button
        android:id="@+id/bt2"
        android:text="Java"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="clickBtn"
        android:layout_gravity="center"/>

</LinearLayout>

 

Output:

xml + java Combination