0% found this document useful (0 votes)
14 views1 page

Practical07 01

The document contains code for an Android login screen. It includes the activity_main.xml layout file which contains TextViews and EditTexts for a username and password. It also includes the Strings.xml file which defines text strings like "app_name" and field labels. The MainActivity Java file contains the onCreate method to set the layout view.

Uploaded by

Varad Gorhe
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
14 views1 page

Practical07 01

The document contains code for an Android login screen. It includes the activity_main.xml layout file which contains TextViews and EditTexts for a username and password. It also includes the Strings.xml file which defines text strings like "app_name" and field labels. The MainActivity Java file contains the onCreate method to set the layout view.

Uploaded by

Varad Gorhe
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 1

Code :- Strings.

xml

activity_main.xml : <resources>
<string name="app_name">Practical_07_01</string>
<?xml version="1.0" encoding="utf-8"?> <string name="user_name">User Name</string>
<androidx.constraintlayout.widget.ConstraintLayout <string name="password">Password</string>
xmlns:android="http://schemas.android.com/apk/res/android" </resources>
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" MainActivity.java
tools:context=".MainActivity">
package com.example.practical_07_01;
<TextView
android:id="@+id/username" import androidx.appcompat.app.AppCompatActivity;
android:layout_width="wrap_content"
android:layout_height="wrap_content" import android.os.Bundle;
android:text="@string/user_name"
tools:layout_editor_absoluteX="42dp" public class MainActivity extends AppCompatActivity {
tools:layout_editor_absoluteY="88dp"
tools:ignore="MissingConstraints" /> @Override
protected void onCreate(Bundle savedInstanceState) {
<EditText super.onCreate(savedInstanceState);
android:layout_width="190dp" setContentView(R.layout.activity_main);
android:layout_height="20dp" }
android:autofillHints="" }
android:hint="username"
android:inputType="TODO" output :-
tools:ignore="MissingConstraints,TextFields"
tools:layout_editor_absoluteX="142dp"
tools:layout_editor_absoluteY="88dp" />

<TextView
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/password"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="42dp"
tools:layout_editor_absoluteY="143dp" />

<EditText
android:layout_width="192dp"
android:layout_height="20dp"
android:autofillHints=""
android:hint="password"
android:inputType="TODO"
tools:ignore="MissingConstraints,TextFields"
tools:layout_editor_absoluteX="142dp"
tools:layout_editor_absoluteY="143dp" />

</androidx.constraintlayout.widget.ConstraintLayout>

You might also like