1.Cretae a new ANDROID PROJECT
File>>New>>Android Project
2.Desining Login Sreen
res/layout/login.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" >
<TextView
android:id="@+id/logEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/email"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/logeditEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textEmailAddress"
android:hint="@string/hintemail"/>
<TextView
android:id="@+id/logpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pass"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/logeditpass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/passHint"/>
<Button
android:id="@+id/logButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/logregister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/registernew"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</LinearLayout>
3.Desining The Registration Sreen
res/layout/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" >
<TextView
android:id="@+id/regName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/name"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/regeditName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="text"
android:hint="@string/hint"/>
<TextView
android:id="@+id/regEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/email"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/regeditEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textEmailAddress"
android:hint="@string/hint"/>
<TextView
android:id="@+id/regpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pass"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/regeditpass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/passHint"/>
<Button
android:id="@+id/regButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
4.Defining Values In The String.sml
res/values/string.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LOGINANDREGISTER</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="name">UserName</string>
<string name="email">Email</string>
<string name="hint">Enter Username</string>
<string name="hintemail">Enter Email</string>
<string name="pass">Password</string>
<string name="passHint">Enter Password</string>
<string name="login">Login</string>
<string name="registernew">New User?Register Here</string>
<string name="register">Register</string>
</resources>
5.Creating Activity Classes For Login And Register Sreens
5.1 Activity Class For login.xml
src/LoginActivity.java
package com.example.loginandregister;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class LoginActivity extends Activity {
TextView Newreg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
Newreg = (TextView)findViewById(R.id.logregister);
Newreg.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
Intent intent = new Intent(LoginActivity.this,RegisterActivity.class);
startActivity(intent);
}
});
}
}
File>>New>>Android Project
2.Desining Login Sreen
res/layout/login.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" >
<TextView
android:id="@+id/logEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/email"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/logeditEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textEmailAddress"
android:hint="@string/hintemail"/>
<TextView
android:id="@+id/logpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pass"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/logeditpass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/passHint"/>
<Button
android:id="@+id/logButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/logregister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/registernew"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</LinearLayout>
3.Desining The Registration Sreen
res/layout/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" >
<TextView
android:id="@+id/regName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/name"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/regeditName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="text"
android:hint="@string/hint"/>
<TextView
android:id="@+id/regEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/email"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/regeditEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textEmailAddress"
android:hint="@string/hint"/>
<TextView
android:id="@+id/regpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pass"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<EditText
android:id="@+id/regeditpass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/passHint"/>
<Button
android:id="@+id/regButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
4.Defining Values In The String.sml
res/values/string.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LOGINANDREGISTER</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="name">UserName</string>
<string name="email">Email</string>
<string name="hint">Enter Username</string>
<string name="hintemail">Enter Email</string>
<string name="pass">Password</string>
<string name="passHint">Enter Password</string>
<string name="login">Login</string>
<string name="registernew">New User?Register Here</string>
<string name="register">Register</string>
</resources>
5.Creating Activity Classes For Login And Register Sreens
5.1 Activity Class For login.xml
src/LoginActivity.java
package com.example.loginandregister;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class LoginActivity extends Activity {
TextView Newreg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
Newreg = (TextView)findViewById(R.id.logregister);
Newreg.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
Intent intent = new Intent(LoginActivity.this,RegisterActivity.class);
startActivity(intent);
}
});
}
}
5.2 Creating Activity Class For register.xml
src/RegisterActivity.xml
package com.example.loginandregister;
import android.app.Activity;
import android.os.Bundle;
public class RegisterActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.register);
}
}
6.Defing The Activity Class In Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.loginandregister"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.loginandregister.LoginActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.loginandregister.RegisterActivity"
android:label="@string/app_name" ></activity>
</application>
</manifest>
Comment,Don't Forget
Comment,Don't Forget
good job:) might help to professionals who are working on it..
ReplyDeleteGood work.Its a really useful. Keep it up.!!
ReplyDeleteandroid application development
good job..
ReplyDeletegud job:) Might be It help to.........who are working in android????????
ReplyDeleteReally helpful for Android Beginners....great job...keep it up....Post some blogs for Springs n Hibernate also.....
ReplyDeleteGood one.... hiiiiigh 5!!!!!!! keep it up
ReplyDeleteGood:)
ReplyDeleteGood Job Guru.... Keep it up..
ReplyDeleteAll the best.