Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Android App Dev Lab: XML & Java Code for Login & User Profile Pages, Lab Reports of Computer Science

The XML and Java code for the login and user profile pages of an Android mobile application developed in the lab URK18CS144 of the 18CS2056 course. The code includes the layout design of the login page with EditText fields for username and password, a Button for login, and a TextView for the link to the registration page. The user profile page consists of TextViews for displaying the user's email, phone number, date of birth, and username, and a Button for updating the password.

Typology: Lab Reports

2017/2018

Uploaded on 11/17/2021

chris-joe-2
chris-joe-2 ๐Ÿ‡ฎ๐Ÿ‡ณ

1 document

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
18CS2056 โ€“ Mobile Application Development using
Android Lab
URK18CS144
Ex. No. 5 Sign-In and Sign Up App using SQLite Database
Date of Exercise 25-08-2021
YouTube Video Link https://youtu.be/IbAz3ey526k
Aim
To develop an android application to provide user registration and login verification
functionalities using SQLite Database with SQLiteOpenHelper data storage and retrieval.
Program
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
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"
android:background="@drawable/backroundbg"
tools:context=".MainActivity">
<TextView
android:id="@+id/logintext"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="85dp"
android:fontFamily="sans-serif-condensed-light"
android:text="Login Page"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="25dp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/imageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
76
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Android App Dev Lab: XML & Java Code for Login & User Profile Pages and more Lab Reports Computer Science in PDF only on Docsity!

18CS2056 โ€“ Mobile Application Development using

Android Lab

Ex. No. 5 Sign-In and Sign Up App using SQLite Database

Date of Exercise 25-08-

YouTube Video Link https://youtu.be/IbAz3ey526k

Aim

To develop an android application to provide user registration and login verification

functionalities using SQLite Database with SQLiteOpenHelper data storage and retrieval.

Program

activity_main.xml

18CS2056 โ€“ Mobile Application Development using

Android Lab

app:layout_constraintTop_toTopOf="parent" /> <Button android:id="@+id/buttonlogin" android:layout_width="211dp" android:layout_height="wrap_content" android:layout_marginBottom="9dp" android:background="@drawable/buttonbg"

18CS2056 โ€“ Mobile Application Development using

Android Lab

package com.example.exp5; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity { EditText user, password; Button loginbtn; TextView textlink; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout. activity_main ); user = findViewById(R.id. username ); password = findViewById(R.id. password ); loginbtn = findViewById(R.id. buttonlogin ); textlink = findViewById(R.id. textlink ); final DBHelper DB= new DBHelper(this, "USER", null, 1 ); textlink.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { newuseractivity(); } }); loginbtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String username=user.getText().toString();

18CS2056 โ€“ Mobile Application Development using

Android Lab

String passwordcheck=password.getText().toString(); Boolean s=DB.checkUser(username, passwordcheck); if(s==true) {Toast. makeText (MainActivity.this, "Log in successful", Toast. LENGTH_LONG ).show(); userprofileactivity(); } else Toast. makeText (MainActivity.this,"invalid Credentials",Toast. LENGTH_LONG ).show(); } }); } public void newuseractivity() { Intent intent = new Intent(MainActivity.this, NewUser.class); startActivity(intent); } public void userprofileactivity() { Intent intent = new Intent(MainActivity.this,UserProfile2.class); intent.putExtra("Username", user.getText().toString()); startActivity(intent); } } activity_user_profile2.xml

18CS2056 โ€“ Mobile Application Development using

Android Lab

android:layout_height="wrap_content" android:layout_marginStart="52dp" android:layout_marginTop="1dp" android:text="Phone" android:textColor="@color/white" app:layout_constraintStart_toStartOf="@+id/twoupdatebuttonuser" app:layout_constraintTop_toBottomOf="@+id/twoprofile_t2" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2dp" android:layout_marginBottom="2dp" android:text="Username" android:textColor="@color/white"

18CS2056 โ€“ Mobile Application Development using

Android Lab

app:layout_constraintBottom_toTopOf="@+id/twoprofile_t1" app:layout_constraintStart_toStartOf="@+id/twoprofile_t1" />