Best Android Registration Form UI Design Xml Code
Many Android application needs to design Registration Form and this article can help you to know that how to design and connect registration detais of users in database using PHP and JAVA.
In this article i want to explain the basic of Registration Form design first and then connectivity of Registered details with Database.
Screenshot for output of this program
Steps for Android Studio Project
- Create a new project in Android Studio File > New Android Project.
- Give name of first Activity as you wish. here Register Activity.
- Go to Gradle:app and enter following gradle files dependencies.
Gradle files for Design, Cardview and Circularimageview
compile 'com.android.support:design:25.0.1'compile 'com.android.support:cardview-v7:25.0.1'compile 'com.mikhaellopez:circularimageview:3.0.2'
In Register.xml type following code
<?xml version="1.0" encoding="utf-8"?> <LinearLayout 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/activity_register" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/bluecolorbest" tools:context="com.example.jagdish.makemyplace.Activity.Register"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="@color/colorPrimaryDark"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/linearcamera" android:layout_marginBottom="25dp" android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="10dp" android:orientation="vertical"> <com.example.jagdish.makemyplace.Activity.RoundedimageView android:layout_width="100dp" android:layout_height="100dp" android:src="@drawable/jkbig" android:layout_marginBottom="10dp" android:id="@+id/imgregister" android:layout_gravity="center" /> <EditText android:id="@+id/ed_reg_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/edittextstyle" android:drawableLeft="@drawable/ic_users" android:drawableTint="@color/colorPrimaryDark" android:drawablePadding="5dp" android:singleLine="true" android:hint="Name" android:textColorHint="@color/colorPrimaryDark" android:inputType="textEmailAddress" /> <EditText android:layout_marginTop="8dp" android:id="@+id/ed_reg_email" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableLeft="@drawable/ic_email" android:drawableTint="@color/colorPrimaryDark" android:drawablePadding="5dp" android:singleLine="true" android:hint="Email ID" android:textColorHint="@color/colorPrimaryDark" android:background="@drawable/edittextstyle" android:inputType="textEmailAddress" /> <EditText android:layout_marginTop="8dp" android:id="@+id/ed_reg_pwd1" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableLeft="@drawable/ic_locks" android:drawableTint="@color/colorPrimaryDark" android:drawablePadding="5dp" android:singleLine="true" android:password="true" android:hint="Password" android:textColorHint="@color/colorPrimaryDark" android:background="@drawable/edittextstyle" android:inputType="textPassword" /> <EditText android:layout_marginTop="8dp" android:id="@+id/ed_reg_pwd2" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableLeft="@drawable/ic_lock" android:drawableTint="@color/colorPrimaryDark" android:drawablePadding="5dp" android:singleLine="true" android:password="true" android:hint="Confirm password" android:textColorHint="@color/colorPrimaryDark" android:background="@drawable/edittextstyle" android:inputType="textPassword" /> <EditText android:layout_marginTop="8dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Enter Mobile" android:textColorHint="@color/colorPrimaryDark" android:background="@drawable/edittextstyle" android:drawableLeft="@drawable/ic_phone" android:drawableTint="@color/colorPrimaryDark" android:drawablePadding="5dp" android:singleLine="true" android:id="@+id/ed_reg_mobile"/> <RadioGroup android:id="@+id/radio_gender" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:gravity="center" android:orientation="horizontal"> <RadioButton android:id="@+id/rb_reg_male" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Male"/> <RadioButton android:id="@+id/rb_reg_female" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:text="Female"/> </RadioGroup> <Button android:layout_width="190dp" android:layout_height="50dp" android:id="@+id/registerbtn" android:background="@drawable/buttonstyle" android:text="Register" android:layout_gravity="center" android:textAllCaps="false" android:textColor="@android:color/white" android:layout_marginTop="5dp"/> </LinearLayout> </android.support.v7.widget.CardView> </LinearLayout>
AndroidManifest.xml for Register Activity
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.jagdish.makemyplace"> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/mmplace" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".Activity.Register" android:label="Registration"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.example.jagdish.makemyplace.Activity.Login" /> </activity> </application> </manifest>
I want full code
ReplyDeletePlzz can u give me MainActivity. java file
ReplyDeletecan u give java code
ReplyDelete