Login And Registration Using SQLite Database and Show Particular ID Data in User Profile Activity

Example Screen Shots :
-------------------------------------------------------------------------------------------------------------------------

1 ) Splash Screen :





2 ) Login Screen :



3 ) Registration Screen :

       

4 ) Show Particular Student Data After Login Successfully : 

       


-------------------------------------------------------------
XML Files
-------------------------------------------------------------
1 ) splash_screen.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
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:id="@+id/rl_splash"    
android:background="@color/white"    
android:layout_height="match_parent"    
tools:context=".Activity.SplashScreen">


<ImageView
      android:visibility="gone"       
android:layout_alignParentBottom="true"
android:src="@drawable/logo"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:layout_centerInParent="true"
android:id="@+id/iv_bus"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:src="@drawable/gsrtc" />
</RelativeLayout>

-------------------------------------
2) activity_login.xml

<?xml version="1.0" encoding="utf-8"?><RelativeLayout 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:id="@+id/rl_login"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:background="@drawable/animation_list"    android:orientation="vertical"    tools:context=".Activity.Login">

    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        android:background="@color/app_bg2">

    </RelativeLayout>

    <ImageView        android:layout_width="match_parent"        android:layout_height="150dp"        android:layout_marginTop="25dp"        android:foregroundGravity="center_horizontal"        android:src="@drawable/gsrtc" />


    <android.support.v7.widget.CardView 
        xmlns:card_view="http://schemas.android.com/apk/res-auto"        android:id="@+id/card_view"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_centerInParent="true"        android:layout_gravity="center"        android:layout_marginLeft="30dp"        android:layout_marginRight="30dp"        android:background="@color/app_bg1"        android:fitsSystemWindows="true"        android:outlineAmbientShadowColor="@color/black"        android:outlineSpotShadowColor="@color/black"        card_view:cardBackgroundColor="@color/app_bg1"        card_view:cardCornerRadius="10dp"        card_view:cardElevation="15dp"        card_view:cardPreventCornerOverlap="true">


        <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_gravity="center_vertical|center_horizontal"            android:orientation="vertical">


            <TextView                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_above="@+id/card_view"                android:layout_gravity="center_horizontal"                android:background="@color/colorPrimaryDark"                android:gravity="center_horizontal"                android:paddingTop="5dp"                android:paddingBottom="5dp"                android:text="USER LOGIN"                android:textColor="@color/white"                android:textSize="15sp"                android:textStyle="bold" />


            <com.github.florent37.materialtextfield.MaterialTextField                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_gravity="center_horizontal"                android:layout_marginLeft="10dp"                android:layout_marginTop="10dp"                android:layout_marginRight="10dp"                app:mtf_cardCollapsedHeight="4dp"                app:mtf_hasFocus="false"                app:mtf_image="@drawable/ic_email_black_24dp"                app:mtf_openKeyboardOnFocus="true"                card_view:mtf_labelColor="@color/cyan_500">

                <!--                app:mtf_animationDuration="1000"                app:mtf_cardColor="@color/cardview_dark_background"                app:mtf_labelColor="@android:color/holo_red_dark"                app:mtf_openKeyboardOnFocus="true"                -->
                <EditText                    android:id="@+id/et_Login_email"                    android:layout_width="match_parent"                    android:layout_height="wrap_content"                    android:hint="Email Id"                    android:imeOptions="actionNext"                    android:inputType="textEmailAddress"                    android:maxLines="1"                    android:textColor="@color/colorPrimaryDark"                    android:textColorHint="@android:color/white"                    android:textSize="15sp" />

            </com.github.florent37.materialtextfield.MaterialTextField>

            <com.github.florent37.materialtextfield.MaterialTextField                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_gravity="center_horizontal"                android:layout_marginLeft="10dp"                android:layout_marginTop="5dp"                android:layout_marginRight="10dp"                app:mtf_cardCollapsedHeight="4dp"                app:mtf_hasFocus="false"                app:mtf_image="@drawable/ic_lock_black_24dp"                app:mtf_openKeyboardOnFocus="true"                card_view:mtf_labelColor="@color/cyan_500">

                <!--                app:mtf_animationDuration="1000"                app:mtf_cardColor="@color/cardview_dark_background"                app:mtf_labelColor="@android:color/holo_red_dark"                app:mtf_openKeyboardOnFocus="true"                -->
                <EditText                    android:id="@+id/et_Login_pswd"                    android:layout_width="match_parent"                    android:layout_height="wrap_content"                    android:hint="Password"                    android:imeOptions="actionNext"                    android:inputType="textPassword"                    android:maxLines="1"                    android:textColor="@color/colorPrimaryDark"                    android:textColorHint="@android:color/white"                    android:textSize="15sp" />

            </com.github.florent37.materialtextfield.MaterialTextField>

            <LinearLayout                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_marginTop="10dp"                android:orientation="horizontal">

                <CheckBox                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_marginLeft="5dp"                    android:text="Remember me" />

                <RelativeLayout                    android:layout_width="match_parent"                    android:layout_height="wrap_content">

                    <TextView
                        android:layout_width="wrap_content"                        android:layout_height="wrap_content"                        android:layout_alignParentEnd="true"                        android:layout_alignParentRight="true"                        android:layout_marginRight="10dp"                        android:text="Forgot Password ?"                        android:textColor="@color/black" />

                </RelativeLayout>

            </LinearLayout>

            <LinearLayout                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_marginTop="10dp"                android:orientation="horizontal"                android:weightSum="9">

                <Button                    android:id="@+id/btn_login"                    android:layout_width="150dp"                    android:layout_height="wrap_content"                    android:layout_gravity="center_horizontal"                    android:layout_marginLeft="10dp"                    android:layout_marginRight="5dp"                    android:layout_marginBottom="30dp"                    android:layout_weight="4"                    android:background="@drawable/round_button"                    android:text="LOG IN"                    android:textColor="@color/white" />

                <View                    android:layout_width="1dp"                    android:layout_height="match_parent"                    android:layout_weight="1"                    android:background="@color/white" />

                <Button                    android:layout_width="150dp"                    android:layout_height="wrap_content"                    android:layout_gravity="center_horizontal"                    android:layout_marginLeft="5dp"                    android:layout_marginRight="10dp"                    android:layout_weight="4"                    android:background="@drawable/round_button_black"                    android:onClick="register"                    android:text="sign up"                    android:textColor="@color/white" />

            </LinearLayout>

        </LinearLayout>

    </android.support.v7.widget.CardView>

</RelativeLayout>

-------------------------------------





Comments

Popular posts from this blog

Android Intent Tutorial