NAME-KESHAV SINGH(975) & ANKUR TYAGI(917)CLASS-BSc(H) COMPUTER SCIENCE III SEMSECTION-ASUBMITTED TO-:MR.RAKESHANDROIDPROGRAMMINGPRACTICALS
1.XML<?xml version="1.0" encoding="utf-8"?><android.widget.RelativeLayoutxmlns:android=""xmlns:app=""xmlns:tools=""android:layout_width="match_parent"android:layout_height="match_parent"tools:context="com.example.dell.helloworld.MainActivity"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Hello World!"android:id="@+id/t1"android:textSize="24sp"android:layout_centerInParent="true"/></android.widget.RelativeLayout>JAVApackagecom.example.shubham.ankurkeshu;importandroid.support.v7.app.AppCompatActivity;importandroid.os.Bundle;public classMainActivityextendsAppCompatActivity {@Overrideprotected voidonCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);}}2.XML<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=""xmlns:tools=""android:id="@+id/activity_main6"android:layout_width="match_parent"
android:layout_height="match_parent"android:paddingBottom="@dimen/activity_vertical_margin"android:paddingLeft="@dimen/activity_horizontal_margin"android:paddingRight="@dimen/activity_horizontal_margin"android:paddingTop="@dimen/activity_vertical_margin"tools:context="com.example.shubham.ankurkeshu.Main6Activity"></RelativeLayout>JAVApackage com.example.shubham.ankurkeshu;import android.app.Activity;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.util.Log;import android.widget.Toast;public class Main6Activity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);Log.d("Lifecycle","on create invoked ");Toast.makeText(getApplicationContext(), "on create invoked", Toast.LENGTH_LONG).show();
setContentView(R.layout.activity_main6);}protected void onStart(){super.onStart();Log.d("Lifecycle","on start invoked ");Toast.makeText(getApplicationContext(), "on start invoked", Toast.LENGTH_LONG).show();}protected void onResume(){super.onResume();Log.d("lifecycle ","on Resume invoked ");Toast.makeText(getApplicationContext(), "on resume invoked", Toast.LENGTH_LONG).show();}protected void onPause(){super.onPause();Log.d("lifecycle ","on Pause invoked ");Toast.makeText(getApplicationContext(), "on pause invoked", Toast.LENGTH_LONG).show();}protected void onStop(){super.onStop();Log.d("lifecycle ","on Stop invoked ");Toast.makeText(getApplicationContext(), "on stop invoked", Toast.LENGTH_LONG).show();}protected void onRestart(){super.onRestart();
Log.d("lifecycle ","on Restart invoked ");Toast.makeText(getApplicationContext(), "on restart invoked", Toast.LENGTH_LONG).show();}protected void onDestroy(){super.onDestroy();Log.d("lifecycle ","on Destroy invoked ");Toast.makeText(getApplicationContext(), "on destroy invoked", Toast.LENGTH_LONG).show();}}3&10&11.XML<?xml version="1.0" encoding="utf-8"?>
Upload your study docs or become a
Course Hero member to access this document
Upload your study docs or become a
Course Hero member to access this document
End of preview. Want to read all 57 pages?
Upload your study docs or become a
Course Hero member to access this document
Term
Winter
Professor
Tanmoy
Tags
Return statement, Void type