}
Second.java
package com.example.allinone;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.Spinner;
import android.widget.TimePicker;
import android.widget.TimePicker.OnTimeChangedListener;
import android.widget.Toast;
public class Second extends Activity {
Button sbmt,clear;
EditText name,mail;
DatePicker dp;
TimePicker tp;
Spinner sp;
RadioGroup rg;
RadioButton m,f;
CheckBox g,h,e;
String nm,ml,dt,tt,str,gen,lang,tm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
sbmt=(Button)findViewById(R.id.submit);
clear=(Button)findViewById(R.id.Clear);
name=(EditText)findViewById(R.id.name);
mail=(EditText)findViewById(R.id.mail);
dp=(DatePicker)findViewById(R.id.dp);
tp=(TimePicker)findViewById(R.id.tp);
sp=(Spinner)findViewById(R.id.Stream);
rg=(RadioGroup)findViewById(R.id.rg);
g=(CheckBox)findViewById(R.id.g);
h=(CheckBox)findViewById(R.id.h);
e=(CheckBox)findViewById(R.id.e);
sbmt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
nm=name.getText().toString();
ml=mail.getText().toString();
dt=dp.getDayOfMonth()+"/"+dp.getMonth()+"/"+dp.getYear();
tp.setIs24HourView(false);
tt=getTime();
tp.setOnTimeChangedListener(new OnTimeChangedListener() {
@Override
public void onTimeChanged(TimePicker arg0, int arg1, int arg2) {
// TODO Auto-generated method stub
tt=getTime();
Toast.makeText(getApplicationContext(), ""+tt, 50).show();
}
});
int id=rg.getCheckedRadioButtonId();
if(id == R.id.m)
gen="Male";
else
gen="Female";
Toast.makeText(getApplicationContext(), "Gen : " + gen, 50).show();
str=sp.getSelectedItem().toString();
if(g.isChecked() && h.isChecked() && e.isChecked()){
lang=g.getText()+","+h.getText()+","+e.getText();
}else if( h.isChecked() && e.isChecked())
{
lang=h.getText()+","+e.getText();
}
else if(g.isChecked() && h.isChecked() ){
lang=g.getText()+","+h.getText();
}
else if(g.isChecked() && e.isChecked() ){
lang=g.getText()+","+e.getText();
}
else if(g.isChecked() ){
lang=g.getText().toString();
}
else if(e.isChecked() ){
lang=e.getText().toString();
}else if(h.isChecked() ){
lang=h.getText().toString();
}
else{
lang="Un Educated";
}
Log.e("intent pahela" ,"pass");
Intent i=new Intent(getApplicationContext(),Third.class);
i.putExtra("name", nm);
i.putExtra("mail", ml);
i.putExtra("date", dt);
i.putExtra("time", tt);
i.putExtra("gender",gen);
i.putExtra("stream",str);
i.putExtra("lang",lang);
startActivity(i);
}
public String getTime(){
tm=tp.getCurrentHour()+":"+tp.getCurrentMinute();
return tm;
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_second, menu);
return true;
}
}
Third.java
package com.example.allinone;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
public class Third extends Activity {
Button time;
ImageView iv;
Button r,t,s,a;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_third);
s=(Button)findViewById(R.id.button4);
a=(Button)findViewById(R.id.button3);
t=(Button)findViewById(R.id.button2);
r=(Button)findViewById(R.id.button1);
time=(Button)findViewById(R.id.time);
iv=(ImageView)findViewById(R.id.imageView1);
Bundle b;
b=getIntent().getExtras();
Log.e("intent pachi" ,"pass");
String n=b.getString("name").toString();
String m=b.getString("mail").toString();
String g=b.getString("gender").toString();
String d=b.getString("date").toString();
String t=b.getString("time").toString();
String s=b.getString("stream").toString();
String l=b.getString("lang").toString();
time.setText("Name : " + n + " \n Gen : " + g+ " \n Mail : " + m + " \n Date : " + d + " \n Time : " + t + " \n Stream : " + s + " \n Language : " + l + " \n ") ;
}
public void rotate(View v){
Animation anim=AnimationUtils.loadAnimation(getApplicationContext(),R.anim.r);
iv.startAnimation(anim);
}
public void translate(View v){
Animation anim=AnimationUtils.loadAnimation(getApplicationContext(),R.anim.t);
iv.startAnimation(anim);
}
public void alpha(View v){
Animation anim=AnimationUtils.loadAnimation(getApplicationContext(),R.anim.a);
iv.startAnimation(anim);
}
public void scale(View v){
Animation anim=AnimationUtils.loadAnimation(getApplicationContext(),R.anim.s);
iv.startAnimation(anim);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_third, menu);
return true;
}
}
Animatoin Files
a.xml {alpha}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<set>
<alpha android:fromAlpha="0.5"
android:toAlpha="1"
android:duration="2000"
android:startOffset="2000"
>
</alpha>
</set>
</set>
r.xml {rotate}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<set><rotate
android:fromDegrees="0"
android:toDegrees="360"
android:duration="4000"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite">
</rotate>
</set></set>
s.xml {scale}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<set>
<scale
android:toXScale="1"
android:fromYScale="0.5"
android:toYScale="1"
android:fromXScale="0.5"
android:duration="2000"
android:repeatCount="infinite"/>
</set>
</set>
t.xml {translate}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<set>
<translate android:fromXDelta="0%p"
android:toXDelta="75%p"
android:duration="800"
>
</translate>
</set></set>