Professional Documents
Culture Documents
Question Bank - ct1
Question Bank - ct1
Question Bank - ct1
1. Open Source
2. User Interface
3. Mult-tasking
4. Connectivity (Wifi, BT, Hotspot, NFC)
5. Multi Touch
6. Multiple Language Support
List any four folders from directory structure of Android project and elaborate in one line
Applications
This is the top layer, and it's what you interact with as a user. It includes all the apps you
download and use on your phone, such as games, social media apps, and more.
Application Framework
This layer provides the building blocks that apps need to run. It includes things like:
o Activity Manager: Manages the lifecycle of activities, which are the screens you see
within an app.
o View System: Renders the UI for apps.
Libraries
This layer provides pre-written code that developers can use to build their apps. It includes things
like:
o Android SDK: Provides core classes and APIs for Android development.
o Support Library: Provides additional APIs that are compatible with older versions of
Android.
Android Runtime (ART)
This layer is responsible for running Android apps. It includes:
o Dalvik Virtual Machine (DVM): Executes Android app code.
o Android Runtime: Provides additional features for running Android apps, such as garbage
collection and security.
Linux Kernel
This is the core of the Android system. It provides low-level access to hardware, such as the
camera and microphone. It also handles things like memory management and security.
Explain OHA
OHA stands for Open Handset Alliance, which is a consortium of technology companies dedicated to
the development and advancement of open standards for mobile devices, particularly smartphones.
OHA's most notable initiative is the development and promotion of the Android platform, an open-
source operating system for mobile devices.
- OHA member companies Supported the open platform concept for a several reasons:
1. Lower overall handset costs
2. Developer-friendly environment
3. Post-development
o Services: Google Mobile Services (GMS) including Gmail, Maps, Drive, etc. (not
included in all regions).
Developers: Large and active community developing apps and contributing to open-source
projects.
Openness: Based on open-source principles, allowing customization and development of forks
like LineageOS.
Fragmentation: Variety of devices and customizations can lead to compatibility issues and
different update timelines.
Security: Regular security updates from Google and manufacturers, but fragmentation can create
vulnerabilities.
Integration: Increasing focus on multi-device experiences with tools like Fast Pair and Nearby
Share.
Competition: Competing ecosystems like iOS from Apple and Fire OS from Amazon.
Chapter2
Differentiate between DVM and JVM
o JVM is high performance and provides excellent memory management. But it needs to be
optimized for
o low-powered handheld devices as well.
o The Dalvik Virtual Machine (DVM) is an android virtual machine optimized for mobile
devices. It
o optimizes the virtual machine for memory, battery life and performance.
o Dalvik is a name of a town in Iceland. The Dalvik VM was written by Dan Bornstein.
o The Dex compiler converts the class files into the .dex file that run on the Dalvik VM.
Multiple class files
o are converted into one dex file.
Chapter3
Explain with example, code to create GUI using absolute layout (Assume suitable data
package com.example.tablecalc;
import android.os.*;
import android.app.*;
import android.view.*;
import android.widget.*;
Observe the following GUI and write an XML file using relative layout to create the
same.
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text = "Top"
android:textSize="50sp"
android:layout_centerHorizontal="true"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text = "Bottom"
android:textSize = "50sp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom = "true"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text = "Left"
android:textSize = "40sp"
android:layout_alignParentLeft = "true"
android:layout_centerVertical = "true"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text = "Right"
android:textSize = "40sp"
android:layout_alignParentRight = "true"
android:layout_centerVertical = "true"/>
</RelativeLayout>
activity_main.xml
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<TimePicker
android:id="@+id/timePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:timePickerMode="clock"
/>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/timePicker"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:text="Get Time"
/>
</RelativeLayout>
MainActivity.java
package com.example.datepicker;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.view.*;
import java.sql.Time;
}
}
activity_main.xml
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<DatePicker
android:id="@+id/datePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:datePickerMode="spinner"
/>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/datePicker"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:text="Get Date"
/>
</RelativeLayout>
MainActivity.java
package com.example.datepicker;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.view.*;
}
}
Write a program to convert temperature from celcius to farenhite and vice versa using
Toggle button. (Design UI as per your choice. Write XML and java file)
package com.example.tempconvert;
import android.app.*;
import android.widget.*;
import android.os.*;
import android.view.*;
tBtn.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
if(tBtn.isChecked())
{
double c = Double.parseDouble(et.getText().toString());
double f = (c*9/5)+32;
tv.setText(f+"F");
}
else
{
double f = Double.parseDouble(et.getText().toString());
double c = (f-32)*5/9;
tv.setText(c+"C");
}
}
});
}
}
Design UI using table layout to display buttons with 0 – 9 numbers on it. Even display
submit and clear button. When user clicks on particular buttons and later when clicks on
submit button, it should display the numbers clicked
Write the directory path where images are stored while developing Android application.
List all attributes to develop a simple button .
Android Project directory structure
o App
o Manifests
AndroidManifest.xml
o Java
MainActivity.java
o Res
Drawable
Layout
Mipmap
Values
o Gradle Scripts