Android Scheme
Android Scheme
Part A
1
application to execute a predefined piece of code or intent at a later time, even if the
originating context of the Pending Intent is no longer active.
7. Write the use of onStop() and onDestroy() methods in activity life cycle.
Explanation for onStop()-1 Mark and onDestroy()-1 Mark
onStop() is used in the Activity lifecycle when the activity is no longer visible to the
user, typically to release resources. onDestroy() is called when the activity is being
destroyed and removed from memory, allowing for final cleanup tasks.
8. How do SQLlte provide database features with a compressed library?
Explanation for SQLite-1 Mark and for the method- 1 Mark
SQLite provides database features with a compressed library by embedding the
SQLite library directly into the application's binary, eliminating the need for a separate
database server.
9. What are the parameters used in insert() method?
Explanation about insert() method-1 mark and for syntax- 1 Mark
long insert(String table, String nullColumnHack, ContentValues values). Table
Name: Specifies the name of the table where the data will be inserted, Null Column
Hack: Allows for the insertion of a null value into a column when providing empty
ContentValues, ContentValues: Holds the values to be inserted into the database,
mapped by column names.
10. Explain packages for SMS telephony.
Explanation for SMS telephony-1 Mark and about packages for Telephony-1
Mark
android.telephony.SmsManager: This package provides the functionality to manage
SMS operations such as sending text messages, multipart messages, and manipulating
message data. android.telephony.SmsMessage:
11. Why JSON is language independent?
Explanation for JSON: 1 Mark. And reason:1 Mark
JSON stands for JavaScript Object Notation. JSON is a lightweight format for storing
and transporting data.
JSON is language-independent because its simple syntax and text-based format make
it easy to parse and generate data across different programming languages.
12. What is the use of Google Maps in Android?
Explanation for Google map: 1 Mark and services: 1 Mark
Google Maps in Android provides location services, detailed maps, navigation, and
the ability to integrate location-based features into applications, enhancing user
experience and functionality.
Part B
Answer any six questions. Each question carries 5 marks.
13. Write Short Note on Emulators.
The Android SDK provides a virtual mobile device emulator that runs on a
computer. An android emulator is used for executing, debugging, and testing
android applications. The emulator helps the developer to run a trial product
virtually without an actual hardware device. An emulator is similar to a physical
hardware mobile device including all the features that an actual mobile contains
except that it cannot place an actual phone call.
2
Hardware Features: 2 Marks
The emulator supports various hardware features like:
ARMv5 CPU AMD corresponding MMU, A 16-bit LCD Display
Dialpad\keyboard, Sound chip, Flash memory, GSM modem, Camera Sensors like
accelerometers.
14. Explain Frame Layout -3 Marks
Frame Layout is designed to block out an area on the screen to display a single
item. Generally, Framelayout should be used to hold a single child view.
Give Marks for Attributes-2 Marks[ android:id, android:foreground etc..
15. What is custom toast alert? How can we implement it state with example?
Defenition: 2 Marks
A Toast is a feedback message. It takes a very little space for displaying while the
overall activity is interactive and visible to the user. It disappears after a few seconds. It
disappears automatically. If the user wants a permanently visible message,
a Notification can be used. Another type of Toast is custom Toast, in which images can be
used instead of a simple message.
Define constants and methods of Toast class : 3 marks
Constants of Toast class
Consta
Nts Description
public static Toast makeText(Context context, makes the toast message consist of
CharSequence text, int duration) text and time duration
public void setMargin (float horizontalMargin, float changes the horizontal and vertical
verticalMargin) differences
16. Create an application that will pass one number to the next screen, and on the next screen
shows the double of that number
Create an Android application that passes a number from one screen to another and displays
the double of that number on the second screen.
3
Create a New Android Project: Start by creating a new Android project in Android Studio.
Design the Layouts: Design the layouts for the two screens. For simplicity, you can just have
an EditText and a Button on the first screen to input the number, and a TextView on the second
screen to display the doubled number.
Implement the Logic: Implement the logic to pass the number from the first screen to the
second screen and display the doubled number.
4
contacts.add(mobileNo + ": " + name);
} while (cursor.moveToNext());
}
cursor.close();
21. How do we retrieve the location address using the location services from android?
Explain with an example
Explanation for location object : 2 marks
The Location object represents a geographic location which can consist of a latitude,
longitude, time stamp, and other information such as bearing, altitude and velocity.
Explanation for the methods methods which you can use with Location object to get
location specific information: 3 Marks
PART C
Answer any two questions.
Each question carries 15 marks.
22. Explain in detail about Android architecture and components with needed diagram
Explanation about Architecture( 3 Marks)
Android architecture contains different number of components to support any
android device needs. Android software contains an open-source Linux Kernel having
collection of number of C/C++ libraries which are exposed through an application
framework services.Among all the components Linux Kernel provides main
functionality of operating system functions to smartphones and Dalvik Virtual Machine
(DVM) provide platform for running an android application. Components(5 Marks)
The main components of android architecture are following:-
Applications, Application Framework,Android Runtime, Platform Libraries, Linux Kernel
Diagram (7 Marks)
23. Explain the following a.Check Box b.Radio Button c.Radio Group d.Toggle Button
e.Progress Bar
For each control: Usage, fig and properties(min 3 ): 3 Marks each
24. Explain in detail Service and Broadcast life cycle with a neat diagram.
Explanation(3 Marks) and diagram for Bounded and unbounded services(5
Marks)
A service is a component that runs in the background to perform long running
operations without needing to interact with the user and it works even if
application is destroyed.
5
Explanation for Broadcst Receiver(3 Marks) with fig(4 Marks)
25.Write short note on a. JSON name b.JSON values c. JSON Objects d. JSON
Arrays.
Basic definition: 3 Marks
In JSON (JavaScript Object Notation), a name refers to the key or attribute within a
JSON object.
Names are strings enclosed in double quotes (" ").
Names are used to uniquely identify values within a JSON object.
Example: In { "name": "John", "age": 30 }, "name" and "age" are JSON names.
JSON values are the data associated with JSON names within a JSON object.
Values can be strings, numbers, boolean values, arrays, objects, or null.
Example: In { "name": "John", "age": 30 }, "John" and 30 are JSON values.
6
JSON objects are enclosed within curly braces {} and consist of key-value pairs.
Each key-value pair in a JSON object represents an attribute of the object.
JSON objects can nest other JSON objects or arrays.
Example: { "name": "John", "age": 30 } is a JSON object with two attributes, "name"
and "age".
JSON arrays are ordered lists of values enclosed within square brackets [].
Values within a JSON array can be of any JSON data type, including strings, numbers,
objects, arrays, booleans, or null.
JSON arrays allow for the representation of collections of similar or related data.
Example: [ "apple", "banana", "orange" ] is a JSON array containing three string
values.
Prepared By
Dr. Dhanya Job
Assistant Professor, BPC College, Piravom, 9747042100