Android Lab 197
Android Lab 197
: 202303103510197
Practical-1
Aim :
Create an Android application by setting appropriate application launcher icon .
Code :
Step 1 - System Requirements
You will be delighted, to know that you can start your Android application development on
either of the following operating systems −
Android Studio is the official IDE for android application [Link] works based on
IntelliJ IDEA, You can download the latest version of android studio from
Android Studio 2.2 Download, If you are new to installing Android Studio on
windows,you will find a file, which is named as android-studio-bundle-143.3101438-
[Link] just download and run on windows machine according to android studio
wizard guideline.
If you are installing Android Studio on Mac or Linux, You can download the latest version
from Android Studio Mac Download,or Android Studio Linux Download, check the
instructions provided along with the downloaded file for Mac OS and Linux. This tutorial
will consider that you are going to setup your environment on Windows machine having
Windows 8.1 operating system.
So let's launch Android [Link],Make sure before launch Android Studio, Our Machine
should required installed Java JDK. To install Java JDK,take a references of Android
environment setup
Once you launched Android Studio, its time to mention JDK7 path or later version in android
studio installer.
Need to check the components, which are required to create applications, below the
image has selected Android Studio, Android SDK, Android Virtual Machine
and performance(Intel chip).
Need to specify the location of local machine path for Android studio and Android SDK,
below the image has taken default location of windows 8.1 x64 bit architecture.
Need to specify the ram space for Android emulator by default it would take 512MB of
local machine RAM.
At final stage, it would extract SDK packages into our local machine, it would take a while
time to finish the task and would take 2626MB of Hard disk space.
After done all above steps perfectly, you must get finish button and it gonna be open
android studio project with Welcome to android studio message as shown below
You can start your application development by calling start a new android studio project. in
a new installation frame should ask Application name, package information and location of
the project.
Practical-2
Aim :
Create an Android application that will demonstrate the use of
each:
a. Android Lifecycle
c. Layouts.
Code :
(activity_main.xml)
<RelativeLayout xmlns:app="[Link]
xmlns:tools="[Link]
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@color/purple_200"
xmlns:android="[Link]
<Button
android:id="@+id/cons"
android:backgroundTint="@color/black"
android:text="Constraint Layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/grid"
android:backgroundTint="@color/black"
android:text="Grid Layout"
android:layout_width="match_parent"
android:layout_below="@+id/cons"
android:layout_height="wrap_content" />
<Button
android:id="@+id/frame" android:text="Frame
Layout"
android:backgroundTint="@color/black"
android:layout_below="@+id/grid"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/linear" android:text="Linear
Layout"
android:backgroundTint="@color/black"
android:layout_below="@+id/frame"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/table"
android:backgroundTint="@color/bl
ack" android:text="Table Layout"
android:layout_below="@+id/linear
"
android:layout_width="match_pare
nt"
android:layout_height="wrap_conte
nt" />
<RadioButton
android:id="@+id/
radioButton"
android:layout_width="200d
p"
android:layout_height="100d
p"
android:layout_below="@id/t
able"
android:layout_marginTop="-
22dp"
android:text="RadioButton"
/>
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Switch" android:layout_below="@id/radioButton"/>
<ImageView
android:id="@+id/imageView" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="@drawable/vvc"
android:layout_below="@id/switch1"/>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="This
is TextView \n Copyright-Bs"
android:layout_centerHorizontal="true"
android:layout_below="@id/imageView"/>
</RelativeLayout>
[[Link]]
package [Link];
import [Link];import
[Link];
import [Link];
import
[Link];import
[Link];
constraint = (Button)findViewById([Link]);grid =
(Button)findViewById([Link]); frame =
(Button)findViewById([Link]); linear =
(Button)findViewById([Link]); table =
(Button)findViewById([Link]);
[Link](new [Link]()
{@Override public void onClick(View view) {
startActivity(new Intent([Link],[Link]));
}
});
[Link](new [Link]()
{@Override public void onClick(View view) {
startActivity(new Intent([Link],[Link]));
}
});
[Link](new [Link]()
{@Override public void onClick(View view) {
startActivity(new Intent([Link],[Link]));
}
});
[Link](new [Link]() {@Override
public void onClick(View view) {
startActivity(new Intent([Link],[Link]));
}
});
[Link](new [Link]()
{@Override public void onClick(View view) {
startActivity(new Intent([Link],[Link]));
}
});
}
}
[[Link]]
package [Link];
import [Link];
import [Link];
public class Constraint extends AppCompatActivity
{@Override
[[Link]]
package [Link];
import [Link];
import
[Link];public
class Frame extends AppCompatActivity { @Override
[[Link]]
package [Link];
import [Link];
import
[Link];public class
Grid extends AppCompatActivity { @Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState); setContentView([Link].activity_grid);
}
[[Link]]
package [Link];
import [Link];
import
[Link];public
class Linear extends AppCompatActivity { @Override
[[Link]]
package [Link];
import [Link];
import [Link];public
class Table extends AppCompatActivity { @Override
[activity_constraint.xml]
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="[Link]">
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
12
Enrollment No. : 202303103510197
<TextView android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textView2" />
<TextView android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="337dp"
android:text="Good Morning"
app:layout_constraintBottom_toTopOf="@+id/textView1"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</[Link]>
[activity_frame.xml]
<FrameLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="[Link]
android">
<TextView
android:text="Hello"
android:gravity="center"
android:textSize="50dp"
android:textColor="@color/black"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
[activity_grid.xml]
<GridLayout
android:orientation="vertical"
android:layout_height="match_parent"
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
13
Enrollment No. : 202303103510197
android:layout_width="match_parent"
android:rowCount="2"
android:columnCount="2"
xmlns:android="[Link]
<TextView
android:text="Hello"
android:textSize="20dp"
android:layout_row="0"
android:layout_column="0"
android:layout_margin="10d
p" />
<TextView
android:text="Helllo1"
android:textSize="20dp"
android:layout_row="0"
android:layout_column="1"
android:layout_margin="10dp
" />
<TextView
android:text="hello 2"
android:textSize="20dp"
android:layout_row="1"
android:layout_column="0"
android:layout_margin="10d
p" />
<TextView
android:text="hello
noob"android:textSize="20dp
" android:layout_row="1"
android:layout_column="1"
android:layout_margin="10d
p" />
</GridLayout>
[activity_linear.xml]
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="[Link]
android">
<TextView
android:text="Hello Good morning"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:src="@mipmap/ic_launcher_round"
android:scaleType="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
[activity_table.xml]
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1"
xmlns:android="[Link]
android">
<TableRow>
<TextView
android:text="Hello"
android:padding="5dip"
android:textSize="50dp"
/>
<TextView android:text="hello1"
android:padding="5dip"
android:textSize="50dp"/>
</TableRow>
<TableRow>
<TextView android:text="hello"
android:padding="5dip"
android:textSize="50dp"
/>
<TextView android:text="hello
noob"android:padding="5dip"
android:textSize="50dp"/>
</TableRow>
</TableLayout>
Output:
Practical-3
Aim :
Design an activity which contains three fragments horizontally.
First fragment contains the gallery of institute, second fragment contains available courses. If
user selects a particular course from the list then third Fragment displays the description of
selected course from the second fragment.
Code :
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
FrameLayout frameLayout;
TabLayout tabLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
getSupportFragmentManager().beginTransaction().replace([Link],new
FirstFragment())
.addToBackStack(null)
.commit();
[Link](new [Link]() {
@Override
public void onTabSelected([Link] tab) {
Fragment fragment=null;
switch ([Link]()){
case 0:
fragment = new FirstFragment();
break;
case 1:
fragment = new SecondFragment();
break;
case 2:
fragment = new ThirdFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace([Link],
fragment)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit();
@Override
public void onTabUnselected([Link] tab) {
@Override
public void onTabReselected([Link] tab) {
}
});
}
}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
/**
* A simple {@link Fragment} subclass.
* Use the {@link FirstFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class FirstFragment extends Fragment {
public FirstFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment FirstFragment.
*/
// TODO: Rename and change types and number of parameters
public static FirstFragment newInstance(String param1, String param2) {
@Override
public void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return [Link]([Link].fragment_first, container, false);
}
}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
/**
* A simple {@link Fragment} subclass.
* Use the {@link SecondFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SecondFragment extends Fragment {
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
21
Enrollment No. : 202303103510197
public SecondFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment SecondFragment.
*/
// TODO: Rename and change types and number of parameters
public static SecondFragment newInstance(String param1, String param2) {
SecondFragment fragment = new SecondFragment();
Bundle args = new Bundle();
[Link](ARG_PARAM1, param1);
[Link](ARG_PARAM2, param2);
[Link](args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
22
Enrollment No. : 202303103510197
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
/**
* A simple {@link Fragment} subclass.
* Use the {@link ThirdFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class ThirdFragment extends Fragment {
public ThirdFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
23
Enrollment No. : 202303103510197
@Override
public void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return [Link]([Link].fragment_third, container, false);
}
}
Activity_main.xml
<[Link]
android:id="@+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#075E34"
app:tabIndicatorColor="@color/white"
app:tabSelectedTextColor="@color/white">
<[Link]
android:id="@+id/tab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="First" />
<[Link]
android:id="@+id/tab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Second" />
<[Link]
android:id="@+id/tab3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Third" />
</[Link]>
<FrameLayout
android:id="@+id/framelayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Fragment_first.xml
</FrameLayout>
Fragment_second.xml
Fragment_third.xml
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ThirdFragment">
Output :
Practical-4
Aim :
Create an application that have two activities:
- Registration of student
- Login
Registration of student activity have “Registration” button and “Login” button. If user clicks
on “Registration” button registration details will be stored in database by using SQLite.
After successful registration, Toast will be displayed with message “Registration done
successfully” and redirect to Login activity.
On successful login go to home screen and display user data on home page.
Registrations of students contain student name, address, contact number, email Id and date of
birth.
Code :
[Link]
package [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];
EditText username,password,repassword;
Button signup, signin;
DBHelper DB;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
[Link](new [Link]() {
@Override
public void onClick(View view) {
String user = [Link]().toString();
String pass = [Link]().toString();
String repass = [Link]().toString();
if([Link]("")||[Link]("")||[Link](""))
[Link]([Link], "Please Enter all the Fields",
Toast.LENGTH_SHORT).show();
else
{
if([Link](repass))
{
Boolean checkuser = [Link](user);
if (checkuser==false)
{
Boolean insert = [Link](user,pass);
if(insert==true)
{
[Link]([Link], "Registered Successfully",
Toast.LENGTH_SHORT).show();
Intent intent = new Intent(getApplicationContext(),[Link]);
startActivity(intent);
}
else
{
[Link]([Link], "Registration Failed",
Toast.LENGTH_SHORT).show();
}
}
else
{
[Link]([Link], "User already exists! Please Sign-In",
Toast.LENGTH_SHORT).show();
}
}
else
{
[Link]([Link], "Repassword in Not matching Password!",
Toast.LENGTH_SHORT).show();
}
}
}
});
[Link](new [Link]() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),[Link]);
startActivity(intent);
}
});
}
}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
30
Enrollment No. : 202303103510197
import [Link];
@Override
public void onCreate(SQLiteDatabase MyDB) {
[Link]("create Table users(username TEXT primary key, password TEXT)");
}
@Override
public void onUpgrade(SQLiteDatabase MyDB, int i, int i1) {
[Link]("drop Table if exists users");
}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText username1,password1;
Button bunlogin;
DBHelper DB;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_login);
[Link](new [Link]() {
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
32
Enrollment No. : 202303103510197
@Override
public void onClick(View view) {
if([Link]("")||[Link](""))
{
[Link]([Link], "Please Enter all the Fields",
Toast.LENGTH_SHORT).show();
}
else
{
Boolean checkuserpass = [Link](user,pass);
if([Link](true))
{
[Link]([Link], "Sign In Successfully",
Toast.LENGTH_SHORT).show();
Intent intent = new Intent(getApplicationContext(),[Link]);
startActivity(intent);
}
else
{
[Link]([Link],"InvalidCredential",Toast.LENGTH_SHO
RT).show();
}
}
}
});
}
}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_home);
}
}
Activity_main.xml
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:hint="Username" />
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:layout_marginTop="50dp"
android:layout_below="@id/username"
/>
<EditText
android:id="@+id/repassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Retype Password"
android:layout_marginTop="50dp"
android:layout_below="@id/password"
/>
<Button
android:id="@+id/bunsignup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Resigter"
android:layout_marginTop="50dp"
android:layout_below="@+id/repassword"
/>
<Button
android:id="@+id/bunsignin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Existiing User! Can goto Sign-Page"
android:layout_marginTop="10dp"
android:layout_below="@+id/bunsignup"
/>
</RelativeLayout>
Activity_login.xml
<EditText
android:id="@+id/username1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:hint="Username" />
<EditText
android:id="@+id/password1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:layout_marginTop="50dp"
android:layout_below="@id/username1"
/>
<Button
android:id="@+id/bunsignin1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/password1"
android:layout_marginTop="50dp"
android:text="Sign-In" />
</RelativeLayout>
Activity_home.xml
</[Link]>
Output :
Practical-5
Aim :
Create an application that will play a media file.
Code :
[Link]
package [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];
[Link] {
String path;
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
38
Enrollment No. : 202303103510197
MediaPlayer mediaPlayer; ImageButton play; Boolean isPlaying = false; int pos = -1;
@Override
path = getExternalFilesDir(Environment.DIRECTORY_MUSIC).getPath();
[Link](new LinearLayoutManager(this));
[Link](this); [Link](adapter);
[Link]([Link].ic_baseline_play_arrow_24);
} else {
[Link]([Link].ic_baseline_pause_24);
});
[Link](view -> {
try {
playSong(files[pos].getPath());
Toast.LENGTH_SHORT).show();
});
[Link](view -> {
try {
playSong(files[pos].getPath());
Toast.LENGTH_SHORT).show();
});
isPlaying = true;
@Override
try {
Toast.LENGTH_SHORT).show();
[Link]
package [Link];
import [Link];
import [Link];
@NonNull @Override
@Override
[Link]([Link](position));
@Override
[Link] {
@Override
activity_main.xml
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link] android:layout_width="match_parent"
android:layout_height="match_parent" tools:context=".MainActivity">
<[Link] android:id="@+id/rview"
android:layout_width="match_parent" android:layout_height="0dp"
app:layout_constraintHeight_percent="0.85" app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toBottomOf="@+id/rview">
android:layout_weight="1"
android:src="@drawable/ic_baseline_skip_previous_24"
android:scaleType="fitCenter"
android:layout_height="match_parent"
<ImageButton
android:id="@+id/play"
android:layout_width="0dp"
android:layout_weight="1"
android:src="@drawable/ic_baseline_play_arrow_24"
android:scaleType="fitCenter"
android:layout_height="match_parent"
android:backgroundTint="@color/purple_500" app:tint="@color/white"/>
<ImageButton
android:id="@+id/next"
android:layout_width="0dp" android:layout_weight="1"
android:src="@drawable/ic_baseline_skip_next_24"
android:scaleType="fitCenter"
android:layout_height="match_parent"
android:backgroundTint="@color/black" app:tint="@color/white"/>
</LinearLayout>
</[Link]>
[Link]
<[Link]
xmlns:android="[Link]
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp" xmlns:app="[Link]
<TextView
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/song"
android:layout_width="match_parent"
android:textAppearance="?android:textAppearanceMedium"
android:layout_height="wrap_content"/>
</[Link]>
Output :
Practical-6
Aim :
Create an application to take picture and video using native application.
Code :
[Link]
package [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];
import [Link];
import [Link];
import [Link];
import [Link];
Uri videoUri;
@Override
File(getExternalFilesDir(Environment.DIRECTORY_DCIM).getAbsolutePath());
try {
[Link]([Link],90,fos); [Link]();
});
File(getExternalFilesDir(Environment.DIRECTORY_DCIM).getAbsolutePath());
});
[Link](cam);
});
[Link](recVid);
});
[Link]();
});
activity_main.xml
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link] android:layout_width="match_parent"
android:layout_height="match_parent" tools:context=".MainActivity">
<ImageView android:id="@+id/imgview"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_width="200dp" android:layout_height="300dp" />
android:layout_height="300dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/imgview"/>
<Button
android:layout_width="match_parent" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/imgview"
android:backgroundTint="@color/black"/>
<Button
android:layout_width="match_parent" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/captureImg"
android:backgroundTint="@color/black"/>
<Button
android:layout_width="match_parent" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/recordVideo"
android:backgroundTint="@color/black"/>
</[Link]>
Output :
Practical-7
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
51
Enrollment No. : 202303103510197
Aim :
Create an application to demonstrate the use of google map.
Code :
[Link]
<manifest xmlns:android="[Link]
package="[Link]">
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]">
<!--
TODO: Before you run your application, you need a Google Maps API key. To get one,
follow the directions here:
[Link]
Once you have your API key (it starts with "AIza"), define a new property in your project's
[Link] file (e.g. MAPS_API_KEY=Aiza...), and replace the "YOUR_API_KEY"
string in this file with "${MAPS_API_KEY}".
-->
<meta-data android:name="[Link].API_KEY"
android:value="AIzaSyACZB4Bo2y2LLFNGIhkkTTINV8Rtfa-vmo" />
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
52
Enrollment No. : 202303103510197
android:label="@string/title_activity_maps">
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>
activity_map.xml
<fragment xmlns:android="[Link]
xmlns:map="[Link]
xmlns:tools="[Link]
android:id="@+id/map"
android:name="[Link]"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity" />
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
{ [Link](savedInstanceState);
binding = [Link](getLayoutInflater());
setContentView([Link]());
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment)
getSupportFragmentManager()
.findFragmentById([Link]); [Link](this);
@Override
Output :
Practical-8
UTU/CGPIT/IT or CS/SEM-5/MOBILE APPLICATION DEVELOPMENT/MAD
55
Enrollment No. : 202303103510197
Aim :
Design and develop an application that have login and
registration form to insert, update, delete and search using firebase. Application should
contain at least two features. (Project)
Output :
Login Page