::: Register login page for android

ใช้ Java and XML layouts
ใช้ SharedPreferences – เก็บ store credentials.

  1. Create the Project Structure -> new project.
    เลือก – Empty Activity – name AuthApp.
    เลือก java
  2. Create activity_register.xml Layout
    res/layout/activity_register.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"
    android:padding="24dp">

    <EditText
        android:id="@+id/etUsername"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Username"/>

    <EditText
        android:id="@+id/etPassword"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Password"
        android:inputType="textPassword"/>

    <Button
        android:id="@+id/btnRegister"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Register"/>

    <Button
        android:id="@+id/btnGoToLogin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Go to Login"/>

</LinearLayout>