Simple Android Calculator App
Simple Android Calculator App
activity_main.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical">
<EditText
android:id="@+id/number1"
android:layout_width="321dp"
android:layout_height="67dp"
android:ems="10"
android:hint="no 1"
android:inputType="number"
tools:layout_editor_absoluteX="93dp"
tools:layout_editor_absoluteY="206dp"
tools:text="Enter Number 1" />
<EditText
android:id="@+id/number2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="no2"
android:inputType="number"
tools:text="Enter Number 2" />
<Button
android:id="@+id/add"
android:layout_width="182dp"
android:layout_height="wrap_content"
android:text="+"
tools:layout_editor_absoluteX="143dp"
tools:layout_editor_absoluteY="402dp" />
<Button
android:id="@+id/sub"
android:layout_width="182dp"
android:layout_height="wrap_content"
android:text="-" />
<Button
android:id="@+id/mul"
android:layout_width="181dp"
android:layout_height="wrap_content"
android:text="X" />
<Button
android:id="@+id/div"
android:layout_width="179dp"
android:layout_height="wrap_content"
android:text="/" />
<TextView
android:id="@+id/result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="result"
android:textSize="25dp" />
</LinearLayout>
[Link]
public class MainActivity extends AppCompatActivity {
EditText e1,e2;
TextView t1;
Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
e1=(EditText)findViewById([Link].number1);
e2=(EditText)findViewById([Link].number2);
t1=(TextView)findViewById([Link]);
b1=(Button)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
Int i1= [Link]([Link]().toString());
Int i2= [Link]([Link]().toString());
Int i3=i1+i2;
[Link]([Link](i3));
}
});
}
2)Simple calculator
<EditText
android:id="@+id/number1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Enter first number"
android:inputType="number" />
<EditText
android:id="@+id/number2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Enter second number"
android:inputType="number" />
<TextView
android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Result"
android:textSize="25dp" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow>
<Button
android:id="@+id/add"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:text="+" />
<Button
android:id="@+id/sub"
android:layout_width="58dp"
android:layout_height="wrap_content"
android:text="-" />
</TableRow>
<TableRow>
<Button
android:id="@+id/mul"
android:layout_width="66dp"
android:layout_height="wrap_content"
android:text="X" />
<Button
android:id="@+id/div"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:text="/" />
</TableRow>
</TableLayout>
</LinearLayout>
JAVA
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
e1=(EditText)findViewById([Link].number1);
e2=(EditText)findViewById([Link].number2);
t1=(TextView)findViewById([Link]);
b1=(Button)findViewById([Link]);
b2=(Button)findViewById([Link]);
b3=(Button)findViewById([Link]);
b4=(Button)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
int i1 = [Link]([Link]().toString());
int i2 = [Link]([Link]().toString());
int i3 = i1 + i2;
[Link]([Link](i3));
}
}) ;
[Link](new [Link]() {
@Override
public void onClick(View v) {
int i1 = [Link]([Link]().toString());
int i2 = [Link]([Link]().toString());
int i3 = i1 - i2;
[Link]([Link](i3));
}
}) ;
[Link](new [Link]() {
@Override
public void onClick(View v) {
int i1 = [Link]([Link]().toString());
int i2 = [Link]([Link]().toString());
int i3 = i1 * i2;
[Link]([Link](i3));
}
}) ;
[Link](new [Link]() {
@Override
public void onClick(View v) {
float i1 = [Link]([Link]().toString());
float i2 = [Link]([Link]().toString());
float i3 = i1 / i2;
[Link]([Link](i3));
}
}) ;
}
}
3) Familiarization of Activity Life Cycle
package [Link].activity_life;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
String tag="activity life cycle";
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
Log.d(tag,"In the onCreate() event");
}
public void onStart()
{
[Link]();
Log.d(tag,"In the onStart() event");
}
java code
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
int num=[Link]([Link]().toString());
factorial(num);
}
});
}
void factorial(double num)
{
int fact =1,i;
for(i=1;i<=num;i++)
{
fact=fact*i;
}
[Link]("Factorial is"+fact);
}
}
<EditText
android:id="@+id/email"
android:layout_width="357dp"
android:layout_height="wrap_content"
android:layout_x="17dp"
android:layout_y="91dp"
android:ems="10"
android:hint="Enter Email"
android:inputType="textPersonName" />
<EditText
android:id="@+id/password"
android:layout_width="337dp"
android:layout_height="wrap_content"
android:layout_x="24dp"
android:layout_y="159dp"
android:ems="10"
android:hint="Password"
android:inputType="textPersonName" />
<Button
android:id="@+id/registers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="148dp"
android:layout_y="238dp"
android:text="Register" />
</AbsoluteLayout>
Main [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
memail=(EditText)findViewById([Link]);
mpassword=(EditText)findViewById([Link]);
mregister=(Button)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
String mail=[Link]().toString();
String pass=[Link]().toString();
if([Link]())
{
[Link]("Email not entered");
}else
{
[Link](null);
}
if([Link]())
{
[Link]("please enter password");
}
else
{
[Link](null);
}
if(![Link]() || ![Link]())
{
Intent intent=new Intent(getApplicationContext(),Activity_2.class);
startActivity(intent);
}
}
});
}
}
Acitivty_2
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="4dp"
android:layout_y="239dp"
android:text="You are successfully Registered"
android:textSize="30dp" />
</AbsoluteLayout>
Activity_main_1
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="172dp"
android:layout_y="335dp"
android:text="Open Activity_2" />
</AbsoluteLayout>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
button=(Button)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
openactivity2();
}
});
<EditText
android:id="@+id/email"
android:layout_width="357dp"
android:layout_height="wrap_content"
android:layout_x="17dp"
android:layout_y="91dp"
android:ems="10"
android:hint="Enter Email"
android:inputType="textPersonName" />
<EditText
android:id="@+id/password"
android:layout_width="337dp"
android:layout_height="wrap_content"
android:layout_x="24dp"
android:layout_y="159dp"
android:ems="10"
android:hint="Password"
android:inputType="textPersonName" />
<Button
android:id="@+id/registers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="148dp"
android:layout_y="238dp"
android:text="Register" />
</AbsoluteLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
private EditText memail, mpassword;
private Button mregister;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
memail=(EditText)findViewById([Link]);
mpassword=(EditText)findViewById([Link]);
mregister=(Button)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
String mail=[Link]().toString();
String pass=[Link]().toString();
if([Link]())
{
[Link]("Email not entered");
}else
{
[Link](null);
}
if([Link]())
{
[Link]("please enter password");
}
else
{
[Link](null);
}
if(![Link]() || ![Link]())
{
Intent intent=new Intent(getApplicationContext(),Activity_2.class);
[Link]("mail",mail);
[Link]("pass",pass);
startActivity(intent);
}
}
});
}
}
Second [Link]
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Activity_2">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="4dp"
android:layout_y="239dp"
android:text="You are successfully Registered"
android:textSize="30dp" />
</AbsoluteLayout>
Activity_2.java
package [Link];
import [Link];
import [Link];
import [Link];
public class Activity_2 extends AppCompatActivity {
String email;
String password;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_2);
email=getIntent().getExtras().getString("mail");
password=getIntent().getExtras().getString("pass");
TextView textView=(TextView)findViewById([Link]);
[Link]("Email :"+" "+email+'\n'+"Password:"+" "+password);
}
}
8) Implicit Intent – Open Browser, Open Map, Dialer
Activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/b1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_x="116dp"
android:layout_y="78dp"
android:background="#E91E63"
android:onClick="goBtn"
android:text="open browser"
tools:layout_editor_absoluteX="141dp"
tools:layout_editor_absoluteY="129dp" />
<Button
android:id="@+id/b2"
android:layout_width="132dp"
android:layout_height="54dp"
android:layout_x="119dp"
android:layout_y="179dp"
android:background="#2769B0"
android:onClick="mapBtn"
android:text="openMap"
tools:layout_editor_absoluteX="161dp"
tools:layout_editor_absoluteY="316dp" />
<Button
android:id="@+id/b3"
android:layout_width="124dp"
android:layout_height="wrap_content"
android:layout_x="117dp"
android:layout_y="291dp"
android:background="#03A9F4"
android:text="DIAL"
tools:layout_editor_absoluteX="161dp"
tools:layout_editor_absoluteY="225dp" />
</AbsoluteLayout>
main_activity.java
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity
{
Button b1;
String msg;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
b1=(Button)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View view) {
Intent intent=new Intent([Link],[Link]);
msg=getIntent().getExtras().getString("msg");
TextView textView=(TextView)findViewById([Link].t1);
[Link](""+msg+"");
startActivity(intent);
}
});
}
}
[Link]
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class activity2 extends AppCompatActivity
{
Button b2;
EditText e2;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_activity2);
b2=(Button)findViewById([Link]);
e2=(EditText)findViewById([Link].e2);
[Link](new [Link]() {
@Override
public void onClick(View view) {
String msg=[Link]().toString();
Intent intent=new Intent([Link],[Link]);
[Link]("msg",msg);
startActivity(intent);
}
});
}
}
10) DIFFERENT LAYOUTS
Activity main
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="94dp"
android:layout_y="67dp"
android:ems="10"
android:inputType="textPersonName"
android:text="DIFFERENT LAYOUTS" />
<Button
android:id="@+id/b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="131dp"
android:layout_y="175dp"
android:text="TABLE LAYOUT" />
<Button
android:id="@+id/b2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="133dp"
android:layout_y="232dp"
android:text="FRAME LAYOUT" />
<Button
android:id="@+id/b3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="135dp"
android:layout_y="291dp"
android:text="Relative Layout" />
</AbsoluteLayout>
MAIN_ACTIVITY .JAVA
package [Link].diff_layout;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
[Link](new [Link]() {
@Override
public void onClick(View v) {
openact2();
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
openact3();
}
});
}
public void openact()
{
Intent intent=new Intent(this,table_layout.class);
startActivity(intent);
}
public void openact2()
{
Intent intent=new Intent(this,Frame_layout.class);
startActivity(intent);
}
public void openact3()
{
Intent intent=new Intent(this,relative_layout.class);
startActivity(intent);
ACTIVITY_TABLE [Link]
</TableRow>
<TableRow android:layout_marginTop="60dp">
<TextView
android:layout_width="150dp"
android:text="Password"/>
<EditText android:layout_width="200dp"/>
</TableRow>
<TableRow>
<Button android:text="Login"/>
</TableRow>
</TableLayout>
ACIVITY_FRAME [Link]
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="100dp"
android:text="Set as Wall paper" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="150dp"
android:text="Home" />
</FrameLayout>
</RelativeLayout>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
[Link] itemClickListener=new
[Link]() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int
position, long id) {
[Link](getBaseContext(),students[position],Toast.LENGTH_SHOR
T).show();
}
};
[Link](itemClickListener);
}
}
<RadioGroup
android:id="@+id/rg1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="119dp"
android:layout_y="59dp">
<RadioButton
android:id="@+id/r1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="130dp"
android:layout_y="179dp"
android:text="C++ prog"
android:textSize="25dp"
android:onClick="check_button"
android:checked="true"/>
<RadioButton
android:id="@+id/r2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="166dp"
android:layout_y="163dp"
android:text="JAVA prog"
android:textSize="25dp"
android:onClick="check_button"/>
<RadioButton
android:id="@+id/r3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="168dp"
android:layout_y="193dp"
android:text="PHP"
android:textSize="25dp"
android:onClick="check_button"/>
</RadioGroup>
<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="50dp"
android:layout_y="12dp"
android:background="#1E88E5"
android:ems="10"
android:inputType="textPersonName"
android:text="Course Fee Calculation"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="113dp"
android:layout_y="172dp"
android:text="Your Selection"
android:textSize="25dp" />
<Button
android:id="@+id/apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="144dp"
android:layout_y="218dp"
android:text="APPLY" />
</AbsoluteLayout>
[Link]
package [Link].radio_toggle;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
RadioGroup rg1;
RadioButton rb1,rb2,rb3,rb;
EditText e1,e2,e3;
TextView tview;
Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
tview=(TextView)findViewById([Link]);
b1=(Button)findViewById([Link]);
rg1=(RadioGroup)findViewById([Link].rg1);
[Link]();
rb1=(RadioButton)findViewById([Link].r1);
rb2=(RadioButton)findViewById([Link].r2);
rb3=(RadioButton)findViewById([Link].r3);
[Link](new [Link]() {
@Override
public void onClick(View v) {
int radioId=[Link]();
rb1=findViewById(radioId);
[Link]("Your Choice:"+[Link]());
}
});
}
public void check_button(View v)
{
int radioId=[Link]();
rb1=findViewById(radioId);
[Link](this, "Your Selected Course is "+[Link](),
Toast.LENGTH_SHORT).show();
}
<EditText
android:id="@+id/discount"
android:layout_width="175dp"
android:layout_height="wrap_content"
android:layout_x="191dp"
android:layout_y="351dp"
android:ems="10"
android:hint="in rupees"
android:inputType="number"
android:textSize="25dp" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="40dp"
android:layout_y="449dp"
android:text="Net Fee"
android:textSize="25dp" />
<EditText
android:id="@+id/netfee"
android:layout_width="171dp"
android:layout_height="wrap_content"
android:layout_x="183dp"
android:layout_y="438dp"
android:ems="10"
android:hint="in rupees"
android:inputType="number"
android:textSize="25dp" />
<ToggleButton
android:id="@+id/tbdiscount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="43dp"
android:layout_y="387dp"
android:text="tbdiscount" />
</AbsoluteLayout>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
ToggleButton tb1;
RadioGroup rg1;
RadioButton rb1,rb2,rb3,rb;
EditText e1,e2,e3;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
tb1=(ToggleButton)findViewById([Link]);
rg1=(RadioGroup)findViewById([Link].rg1);
[Link]();
rb1=(RadioButton)findViewById([Link].r1);
rb2=(RadioButton)findViewById([Link].r2);
rb3=(RadioButton)findViewById([Link].r3);
e1=(EditText)findViewById([Link]);
e2=(EditText)findViewById([Link]);
e3=(EditText)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
if([Link]())
[Link](true);
else
{
[Link](false);
[Link]("0");
}
}
});
[Link](new
[Link]() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
rb=(RadioButton)[Link](checkedId);
String course=[Link]().toString();
if([Link]("C++prog"))
[Link]("5000");
else if ([Link]("JAVA prog"))
[Link]("6000");
else
[Link]("4000");
}
});
[Link](new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int
after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count)
{
if () calcNetFee(); }
@Override
public void afterTextChanged(Editable s) { } });
[Link](new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int
after) { }
@Override
public void onTextChanged(CharSequence s, int start, int before, int count)
{
if () calcNetFee();
}
@Override
public void afterTextChanged(Editable s) { } }); }
public void calcNetFee()
{
float dp,fee,netFee;
String strDP,strFEE;
strDP=[Link]().toString();
strFEE=[Link]().toString();
if () dp=[Link](strDP); else dp=0;
if () fee=[Link](strFEE); else fee=0;
netFee=fee-(fee*dp)/100;
[Link]([Link](netFee));
}
}
main [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
WebView webView=findViewById([Link]);
[Link](new WebViewClient());
[Link]("http:/[Link]");
}
}
activity xml
<TextView
android:id="@+id/t1"
android:layout_width="match_parent"
android:layout_height="126dp"
android:layout_x="0dp"
android:background="#303852"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:text="Webview example"
android:textColor="#99DDD7"
android:textSize="20dp" />
<WebView
android:id="@+id/webview"
android:layout_width="411dp"
android:layout_height="596dp"
android:layout_alignParentBottom="true"
android:layout_x="5dp"
android:layout_y="126dp" />
</AbsoluteLayout>
android [Link]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
package="[Link]">
<uses-permission android:name="[Link]"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="webview"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="[Link]" />
<category android:name="[Link]" />
</intent-filter>
</activity>
</application>
</manifest>
ACTIVITY_MAIN.XML
<TextView
android:id="@+id/itemid"
android:layout_width="196dp"
android:layout_height="40dp"
android:layout_x="193dp"
android:layout_y="58dp"
android:hint="name" />
<ImageView
android:id="@+id/itemimage"
android:layout_width="171dp"
android:layout_height="66dp"
android:layout_x="0dp"
android:layout_y="46dp" />
</AbsoluteLayout>
[Link]
<ListView
android:id="@+id/lvPr"
android:layout_width="match_parent"
android:layout_height="680dp"
android:layout_x="-4dp"
android:layout_y="39dp"></ListView>
</AbsoluteLayout>
[Link]
[Link]
package [Link].listview_image_text;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
ListView lv;
String images[];
int imageID [] =
{[Link],[Link],[Link],[Link]
tina };
ArrayList <HashMap<String,String>> al;
SimpleAdapter ap;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link]);
lv=findViewById([Link]);
images=getResources().getStringArray([Link]);
al=new ArrayList<HashMap<String, String>>();
[Link](getApplicationContext(),images[position],Toast.LENGTH_L
ONG).show();
} }); } }
ACTIVITY_MAIN.XML
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
RadioGroup rg1,rg2;
RadioButton rb,rb1,rb2,rb3,rb4,rb5,rb6,rb7,rb8;
Button b1;
TextView t1,t2,t3;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
rg1=(RadioGroup)findViewById([Link].rg1);
[Link]();
rg2=(RadioGroup)findViewById([Link].rg2);
[Link]();
rb1=(RadioButton)findViewById([Link].rb1);
rb2=(RadioButton)findViewById([Link].rb2);
rb3=(RadioButton)findViewById([Link].rb3);
rb4=(RadioButton)findViewById([Link].rb4);
rb5=(RadioButton)findViewById([Link].rb5);
rb6=(RadioButton)findViewById([Link].rb6);
rb7=(RadioButton)findViewById([Link].rb7);
rb8=(RadioButton)findViewById([Link].rb8);
b1=(Button)findViewById([Link].b1);
t1=(TextView)findViewById([Link].t1);
t2=(TextView)findViewById([Link].t2);
t3=(TextView)findViewById([Link].t3);
[Link](new [Link]() {
@Override
public void onClick(View v) {
int radioId=[Link]();
rb=findViewById(radioId);
if([Link]() && [Link]())
{
int count=2;
[Link]("TOTAL MARKS : "+count);
}
else if([Link]()){
int count=1;
[Link]("TOTAL MARKS : "+count);
}
else if([Link]() ){
int count=1;
[Link]("TOTAL MARKS : "+count);
}
else{
int count=0;
[Link]("TOTAL MARKS : "+count);
}
} }); }
public void check_button(View v)
{
int radioId=[Link]();
rb=findViewById(radioId);
[Link](this, "Your choice is" +[Link](),
Toast.LENGTH_SHORT).show();
}
ACTIVITY_MAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="64dp"
android:text="SIMPLE INTEREST CALCULATOR"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.514"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/e1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:ems="10"
android:hint="Principle amount"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<EditText
android:id="@+id/e2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:ems="10"
android:hint="No. Of Years"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/e1" />
<EditText
android:id="@+id/e3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:ems="10"
android:hint="Rate of Interest"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/e2" />
<Button
android:id="@+id/butten"
android:layout_width="209dp"
android:layout_height="56dp"
android:layout_marginTop="56dp"
android:text="SUBMIT"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/e3"
app:layout_constraintVertical_bias="0.023" />
</[Link]>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
[Link](new [Link]() {
@Override
public void onClick(View v) {
int amt=[Link]([Link]().toString());
int no=[Link]([Link]().toString());
int rate=[Link]([Link]().toString());
float resul=amt*no*rate;
float result=resul/100;
i = new Intent([Link],[Link]);
Bundle b = new Bundle();
[Link]("res",result);
[Link](b);
startActivity(i);
}
//
}); } }
ACTIVITY_RESULT.XML
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".result">
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="260dp"
android:ems="10"
android:hint="result is"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/VideoView_error_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.538"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editText"
app:layout_constraintVertical_bias="0.195" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="208dp"
android:text="Simple Interest is"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.304"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</[Link]>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class result extends AppCompatActivity {
EditText e1;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_result);
Button b1=findViewById([Link]);
e1=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
Bundle a= getIntent().getExtras();
Float text= [Link]("res");
[Link](""+text);
}
});
}
}
17. Create an activity, First activity contain a button named CLICK , when
we click ,it lead to second activity. In second activity, Write code to calculate
area and perimeter of square ,pass the result to first activity
ACTIVITY_MAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="[Link]">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="AREA OF SQUARE"
android:textSize="35dp" />
<TextView
android:id="@+id/text"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:text=""
android:textSize="30dp" />
<TextView
android:id="@+id/text1"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:text=""
android:textSize="30dp" />
<Button
android:layout_marginTop="50dp"
android:layout_width="100dp"
android:layout_height="50dp"
android:onClick="area"
android:text="CLick"/>
</LinearLayout>
</LinearLayout>
ACTIVITY_AREA.XML
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
TextView text,text1;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
text=findViewById([Link]);
text1=findViewById([Link].text1);
}
public void area(View view){
Intent intent=new Intent(this,[Link]);
startActivityForResult(intent,1);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
[Link](requestCode, resultCode, data);
if(requestCode==1 && resultCode==RESULT_OK){
String s=[Link]("area");
String p=[Link]("per");
[Link]("Area is "+s);
[Link]("Perimeter is "+p);
} } }
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class area extends AppCompatActivity {
EditText num;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_area);
num=findViewById([Link]);
}
public void find(View view){
int a=[Link]([Link]().toString());
int area=a*a;
int per=4*a;
Intent intent=new Intent();
[Link]("area",[Link](area));
[Link]("per",[Link](per));
//startActivity(intent);
setResult(Activity.RESULT_OK, intent);
finish();
} }
ACTIVITY_MAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/t1"
android:layout_width="201dp"
android:layout_height="43dp"
android:layout_x="41dp"
android:layout_y="27dp"
android:text="STUDENT DETAILS!"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/rollno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="42dp"
android:layout_y="104dp"
android:ems="10"
android:hint="Enter your roll number"
android:inputType="textPersonName" />
<EditText
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="44dp"
android:layout_y="193dp"
android:ems="10"
android:hint="Enter your name"
android:inputType="textPersonName" />
<EditText
android:id="@+id/branch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="42dp"
android:layout_y="303dp"
android:ems="10"
android:hint="Enter your branch"
android:inputType="textPersonName" />
<Button
android:id="@+id/save"
android:layout_width="230dp"
android:layout_height="wrap_content"
android:layout_x="42dp"
android:layout_y="378dp"
android:text="Save and Continue" />
<Button
android:id="@+id/skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="109dp"
android:layout_y="450dp"
android:text="Skip" />
</AbsoluteLayout>
MAIN_ACTIVITY.JAVA
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
EditText rno,name,branch;
Button btnsave,btnskip;
SharedPreferences prefs;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
rno=findViewById([Link]);
name=findViewById([Link]);
branch=findViewById([Link]);
btnsave=findViewById([Link]);
btnskip=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
String rlno=[Link]().toString();
String nme=[Link]().toString();
String br=[Link]().toString();
prefs=getSharedPreferences("MyPref",MODE_PRIVATE);
[Link] editor=[Link]();
[Link]("rollno",rlno);
[Link]("name",nme);
[Link]("branch",br);
[Link]();
Intent intent=new Intent([Link],[Link]);
startActivity(intent);
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
Intent intent=new Intent([Link],[Link]);
startActivity(intent);
ACIVITY_MAIN2.XML
<TextView
android:id="@+id/t2"
android:layout_width="351dp"
android:layout_height="48dp"
android:layout_x="22dp"
android:layout_y="40dp"
android:text="STUDENT DETAILS"
android:textSize="30sp" />
<TextView
android:id="@+id/tv"
android:layout_width="275dp"
android:layout_height="293dp"
android:layout_x="55dp"
android:layout_y="99dp" />
</AbsoluteLayout>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
tvobs=findViewById([Link]);
prefs=getSharedPreferences("MyPref",MODE_PRIVATE);
String rolno=[Link]("rollno","no values");
String name=[Link]("name","no values");
String bran=[Link]("branch","no values");
[Link](Observations);
}
}
ACTIVITY_MAIN3.XML
<ImageView
android:id="@+id/imageView"
android:layout_width="331dp"
android:layout_height="197dp"
app:srcCompat="@android:drawable/ic_delete"
tools:layout_editor_absoluteX="40dp"
tools:layout_editor_absoluteY="178dp" />
</[Link]>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:padding="5dp"
android:text="Android Read and Write Text from/to a File"
android:textStyle="bold"
android:textSize="28sp" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView1"
android:layout_marginTop="22dp"
android:minLines="5"
android:layout_margin="5dp">
<requestFocus />
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Write Text into File"
android:onClick="WriteBtn"
android:layout_alignTop="@+id/button2"
android:layout_alignRight="@+id/editText1"
android:layout_alignEnd="@+id/editText1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Read Text From file"
android:onClick="ReadBtn"
android:layout_centerVertical="true"
android:layout_alignLeft="@+id/editText1"
android:layout_alignStart="@+id/editText1" />
</RelativeLayout>
MAIN_ACTIVITY.JAVA
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText textmsg;
static final int READ_BLOCK_SIZE = 100;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
textmsg=(EditText)findViewById([Link].editText1);
}
} catch (Exception e) {
[Link]();
}
}
while ((charRead=[Link](inputBuffer))>0) {
// char to string conversion
String readstring=[Link](inputBuffer,0,charRead);
s +=readstring;
}
[Link]();
[Link](s);
} catch (Exception e) {
[Link]();
}
}
}
ACTIVITY_MAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<WebView
android:id="@+id/web"
android:layout_width="418dp"
android:layout_height="582dp"
android:layout_x="0dp"
android:layout_y="55dp" />
</AbsoluteLayout>
MAIN_ACTIVITY.JAVA
package [Link].html5;
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
WebView webView=findViewById([Link]);
[Link]("[Link]
}
}
[Link]
<!DOCTYPE html>
<hmtl>
<head>
</head>
<body>
<b>HELLO WORLD</b>
<br>
<br>
WELCOME TO html5 application development<br>
<button>Click here</button>
</body>
</hmtl>
ACTIVITY_MAIN.xlm
<EditText
android:id="@+id/editroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="88dp"
android:layout_y="96dp"
android:ems="10"
android:hint="Enter Roll No. here"
android:inputType="number" />
<EditText
android:id="@+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="92dp"
android:layout_y="156dp"
android:ems="10"
android:hint="Enter Name Here"
android:inputType="textPersonName" />
<EditText
android:id="@+id/editbranch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="91dp"
android:layout_y="226dp"
android:ems="10"
android:hint="Enter Branch here"
android:inputType="textPersonName" />
<EditText
android:id="@+id/editscore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="100dp"
android:layout_y="286dp"
android:ems="10"
android:hint="Enter Score here"
android:inputType="number" />
<Button
android:id="@+id/btnclear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="202dp"
android:layout_y="396dp"
android:text="CLEAR" />
<Button
android:id="@+id/btnget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="12dp"
android:layout_y="472dp"
android:text="GET STUDENTS" />
<Button
android:id="@+id/btngetall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="144dp"
android:layout_y="471dp"
android:text="GETALL" />
<Button
android:id="@+id/btnupdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="241dp"
android:layout_y="471dp"
android:text="UPDATE SCORE" />
<Button
android:id="@+id/btndelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="120dp"
android:layout_y="535dp"
android:text="DELETE STUDENTS" />
<EditText
android:id="@+id/editText9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="97dp"
android:layout_y="24dp"
android:ems="10"
android:inputType="textPersonName"
android:text="STUDENTS DATABASE" />
<Button
android:id="@+id/btnsaves"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="100dp"
android:layout_y="396dp"
android:text="save" />
</AbsoluteLayout>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
dbh=new DBHelper1(getApplicationContext());
b1=(Button)findViewById([Link]);
b2=(Button)findViewById([Link]);
b3=(Button)findViewById([Link]);
b4=(Button)findViewById([Link]);
b5=(Button)findViewById([Link]);
b6=(Button)findViewById([Link]);
e1=(EditText)findViewById([Link]);
e2=(EditText)findViewById([Link]);
e3=(EditText)findViewById([Link]);
e4=(EditText)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
String roll=[Link]().toString();
String studname=[Link]().toString();
String sbranch=[Link]().toString();
int sscore= [Link]([Link]().toString());
[Link](roll,studname,sbranch,sscore);
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
clearData();
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
[Link](getApplicationContext(),result,Toast.LENGTH_LONG).show();
[Link](getApplicationContext(),na,Toast.LENGTH_LONG).show();
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
[Link](getApplicationContext(),result,Toast.LENGTH_LONG).show();
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
int sc=[Link]([Link]().toString());
String r=[Link]().toString();
[Link](r,sc);
[Link](r);
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
String r=[Link]().toString();
[Link](r);
}
});
}
void clearData()
{
[Link]("");
[Link]("");
[Link]("");
[Link]("");
}
}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
String[]{"rollno","name","branch","score"},"branch='"+branch+"'",null,null,null,nu
ll);
if ([Link]()>0)
{
[Link]();
do{
str=[Link]([Link]("rollno"))+[Link]([Link]("na
me"))+[Link]([Link]("score"));
[Link](str+"\n");
}while([Link]());
}
else
{
[Link]("No Students in " + branch);
}
return result;
}
public void updateScore(String roll,int sc)
{
SQLiteDatabase db=getWritableDatabase();
ContentValues cv=new ContentValues();
[Link]("score",sc);
long id=[Link]("student",cv,"rollno='"+roll+"'",null);
[Link](appContext,"Updated :"+id,Toast.LENGTH_LONG).show();
}
public void deleteStud(String roll) {
SQLiteDatabase db = getWritableDatabase();
long id = [Link]("student", "rollno='" + roll + "'", null);
[Link](appContext, "Deleted :" + id, Toast.LENGTH_LONG).show();
}}
22)DIGITAL BIODATA
USING HTML5
[Link]
<WebView
android:id="@+id/wb"
android:layout_width="409dp"
android:layout_height="729dp"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp" />
</[Link]>
MAIN _ACTIVITY.JAVA
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
WebView webView=findViewById([Link]);
WebSettings webSettings=[Link]();
[Link](true);
[Link](true);
[Link](new WebChromeClient());
[Link]("[Link]
}
}
[Link]
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="[Link]"></script>
</head>
<body bgcolor=" #87CEFA" style="text align:center,margin top:50px">
<div id="main_screen" style="margin top:40%">
<b>DIGITAL BIO DATA </b>
</br>
</br>
[Link]
function openRegister()
{
var div=[Link]('register_screen');
[Link]='block';
var div=[Link]('main_screen');
[Link]='none';
}
function closeRegistration()
{
var div1=[Link]('register_screen');
[Link]='none';
var div2=[Link]('main_screen');
[Link]='block';
}
function register()
{
var fname=[Link]("fname").value;
var lname=[Link]("lname").value;
var dob=[Link]("dob").value;
var blood=[Link]("blood").value;
var email=[Link]("email").value;
[Link]("fname",fname);
[Link]("lname",lname);
[Link]("email",email);
[Link]("dob",dob);
[Link]("blood",blood);
closeRegistration();
alert("Details added successfully");
}
function showHomepage()
{
var div=[Link]('main_screen');
[Link]='none';
var div=[Link]('home_screen');
[Link]='block';
SCREENSHOTS