assignment-1
assignment-1
Assignment 1
1.5 Cupcake
1.6 Donut
2.0/2.1 Eclair
2.2 Froyo
2.3 Gingerbread
3.0/3.1 Honeycomb
4.4 KitKat
5.0 Lollipop
6.0 Marshmallow
7.0 Nougat
8.0 Oreo
9.0 Pie
10 android
The stakeholders are the consumers that own Android devices are:
● Google: It develops Android
● OEMs(Original Equipment Manufacturers): They manufacture the hardware , and as well
the custom application components.
● Application Development Companies: they are the major contributors to the ecosystem
and employ Android developers, and also contract out the product development to
services companies.
● Freelancer android developers: Developers have the skill-set to contribute to the
ecosystem for android development. They are who create their own applications, and
publish them on Google play store. Freelancer can also generate money by developing
applications for product companies.
4) Give the use of following components: (CO3/R)
i)Activities:
● Activities are said to be the presentation layer of our applications.
● The UI of our application is built around one or more extensions of the Activity
class.
● An activity is implemented as a subclass of class Activity.
○ public class MainActivity extends Activity { }
ii)Services:
● These are like invisible workers of our app.
● These components run at backend, updating your data sources and Activities,
triggering Notification and also broadcast Intents.
7) Define Emulator.(CO2/R)
● An android SDK comes with a virtual mobile device emulator that runs on your
computer.
● The emulator enables us to trial products, to develop & test Android applications without
using a physical device.
● It runs on a full Android system stack, down to kernel level, including mobile devices
skin & key mapping.
8) Explain the members of OHA. (CO1/R)
● OHA members are primarily as stated below:
○ Mobile operators
○ Handset manufacturers
○ Software development firms
○ Semiconductor companies
○ Commercialization companies
● The Open Handset Alliance (OHA) is a business alliance that was created for the purpose
of developing open mobile device standards.
● Members share a commitment to expanding the commercial viability of open platform
development.
9) What is the android SDK? (CO2/U)
● The android SDK[software development kit] provides to test android applications, the
API libraries, sample code, developer tools, and tutorials which help you to build, test &
debug apps for android.
● It is made up of 2 parts:
○ Tools
○ Packages
● Features are;
○ No licensing, distribution, or development frees
○ Wi-Fi hardware access
○ API for location based services such as GPS
○ IPC message passing
○ Shared data stores
10) Enlist different types of layout used in UI design. (CO3/R)
● The different types of layouts are:
○ Linear layout
○ Relative layout
○ Table layout
○ Absolute layout
○ Frame layout
○ Constraint layout
11) List components of AVD.(CO2/R)
● An Android Virtual Device[AVD] is an emulator configuration that enables to model an
actual device by calling hardware & software options to be emulated by the Android
Runtime.
○ Libraries:
■ It is written in C/C++ libraries.
■ The communication happens through the Java Native Interface(JNI)
package.
■ This layer has majorly 9 components.
○ Android Runtime:
■ It consists of Dalvik Virtual Machines and Core Libraries.
■ DVM:
● It is a type of JVM used in android devices to run apps.
■ Core libraries:
● These libraries provide most of the functionalities defined in the
Java SE libraries.
○ Data Structure
○ File Access
○ Network Access
○ Utilities
○ Graphics.
○ Linux Kernel:
■ The kernel handles all the things such as networking and a vast array of
device drivers.
■ Following are the drivers:
● Display
● Camera
● Bluetooth
● Flash memory driver
● USB
● WiFi
● Keypad driver
● Audio driver
● Power management driver
2) Explain the need for android. (CO1/U)
● Comprehensive software stack:
○ Android is not just an operating system; it encompasses a complete stack of
software for mobile devices.
● Linux based OS:
○ Android is built on a Linux-based operating system specifically designed for
touchscreen mobile devices like smartphones and tablets.
● Open source technology:
○ Android is an open-source technology, allowing its software to be freely modified
and distributed by device manufacturers, wireless carriers, and developers
"@id/txtName"/>
<TextView
android:id="@+id/txtEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:textSize="24sp"
android:text="Email:[email protected]"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/txtPhone"/>
<TextView
android:id="@+id/txtAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_margin="16dp"
android:textSize="24sp"
android:text="Address: Mulund"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/txtEmail"/>
</androidx.constraintlayout.widget.ConstraintLayout>
JAVA FILE:
package com.example.profconstraintlayout;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
7)Develop a program to implement relative layout using edittext and buttons (CO3/A)
XML CODE:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="
http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<EditText
android:id="@+id/edtTxt"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="24sp"/>
<Button
android:id="@+id/btnOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/edtTxt"
android:layout_marginStart="32dp"
android:layout_alignParentStart="true"
android:text="Previous"/>
<Button
android:id="@+id/btnTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/edtTxt"
android:layout_marginEnd="32dp"
android:layout_alignParentEnd="true"
android:text="Next"/>
</RelativeLayout>
JAVA FILE:
package com.example.relativelayouteditandbtn;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
8) Develop a program to implement marksheet for student using Table layout (CO3/A)
XML:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
tools:context=".MainActivity">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/purple_200"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Enrollment No."/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="MAD"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="PWP"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Total"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="2100040100"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="68"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="69"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="137"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="2100040101"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="66"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="70"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="136"/>
</TableRow>
</TableLayout>
9) Develop a program to implement Framelayout which shows different oops data types ***
10)Write a program to accept and display personal information of students.
XML CODE:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context=".MainActivity">
<EditText
android:id="@+id/nameEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Name" />
<EditText
android:id="@+id/rollNumberEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Roll Number" />
<EditText
android:id="@+id/gradeEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Grade" />
<Button
android:id="@+id/displayButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Display Information"
android:layout_marginTop="16dp"
android:onClick="displayInformation" />
<TextView
android:id="@+id/displayTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text=""
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
JAVA FILE:
package com.example.personalinfoofstud;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
private EditText nameEditText, rollNumberEditText, gradeEditText;
private TextView displayTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
nameEditText = findViewById(R.id.nameEditText);
rollNumberEditText = findViewById(R.id.rollNumberEditText);
gradeEditText = findViewById(R.id.gradeEditText);
displayTextView = findViewById(R.id.displayTextView);
}
public void displayInformation(View view) {
String name = nameEditText.getText().toString().trim();
String rollNumber = rollNumberEditText.getText().toString().trim();
String grade = gradeEditText.getText().toString().trim();
if (!name.isEmpty() && !rollNumber.isEmpty() && !grade.isEmpty()) {
String information = "Name: " + name + "\nRoll Number: " + rollNumber + "\nGrade: "
+
grade;
displayTextView.setText(information);
} else {
displayTextView.setText("Please fill in all fields");
}
}
}
11)write a program to accept username and password from a user using textview and edittext.
XML CODE:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username:"
android:textSize="18sp"/>
<EditText
android:id="@+id/usernameEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter your username"
android:inputType="text"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password:"
android:textSize="18sp"
android:layout_marginTop="16dp"/>
<EditText
android:id="@+id/passwordEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter your password"
android:inputType="textPassword"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit"
android:layout_marginTop="16dp"
android:onClick="submitCredentials"/>
</LinearLayout>
JAVA FILE:
package com.example.usernameandpasswordtxtviewandedittxt;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
private EditText usernameEditText, passwordEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
usernameEditText = findViewById(R.id.usernameEditText);
passwordEditText = findViewById(R.id.passwordEditText);
}
public void submitCredentials(View view) {
String username = usernameEditText.getText().toString().trim();
String password = passwordEditText.getText().toString().trim();
if (!username.isEmpty() && !password.isEmpty()) {
String message = "Username: " + username + "\nPassword: " + password;
showToast(message);
} else {
showToast("Please fill in both fields");
}
}
private void showToast(String message) {
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
}
}
12)write a program to display 3 student basic information in table form using tablelayout.
XML:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
tools:context=".MainActivity">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/purple_200"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Enrollment No."/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Name"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Course"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Div"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="2100040100"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Esha"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="CO"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="A"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="2100040101"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Dinky"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="CO"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="B"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="2100040102"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Abc"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="AO"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="B"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:paddingHorizontal="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="2100040456"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="Hello"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="EJ"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="8dp"
android:textSize="16sp"
android:text="B"/>
</TableRow>
</TableLayout>
13)write a program to place name, age and mobile number centrally on the display screen using
Absolute layout. ***
14)write a program to create a toggle button to display on/off bluetooth on the display screen.
***
15) write a program to create a login form for a social networking site. ***
16)Describe various installation steps of android studio and its environment.
● STEP 1: To download the Android Studio, visit the official Android Studio website in
your web browser and Click on the "Download Android Studio" option
● STEP 2: Double click on downloaded .exe file and then click NEXT
● STEP 3: Select the components you want to install and click NEXT
● STEP 4: Browse the location where you want to install Android and click NEXT
● STEP 5: Now, click on install and then click FINISH button to proceed.
17) Describe directory structure and its components.